Skip to content

Commit

Permalink
Fix the interval time of memory checking in graph background thread (v…
Browse files Browse the repository at this point in the history
…esoft-inc#3175)

* Move ScopedTimer from graph to common module
  • Loading branch information
yixinglu committed Oct 21, 2021
1 parent 0e94042 commit 80f22a8
Show file tree
Hide file tree
Showing 51 changed files with 49 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/

#ifndef GRAPH_UTIL_SCOPEDTIMER_H_
#define GRAPH_UTIL_SCOPEDTIMER_H_
#pragma once

#include <functional>

Expand Down Expand Up @@ -52,5 +51,3 @@ class ScopedTimer final {
#define CONCAT_IMPL(x, y) x##y
#define MACRO_CONCAT(x, y) CONCAT_IMPL(x, y)
#define SCOPED_TIMER(v) ::nebula::ScopedTimer MACRO_CONCAT(_SCOPED_TIMER_, __LINE__)(v)

#endif // GRAPH_UTIL_SCOPEDTIMER_H_
1 change: 1 addition & 0 deletions src/common/time/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nebula_add_test(
duration_test
SOURCES
DurationTest.cpp
ScopedTimerTest.cpp
OBJECTS
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:time_obj>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <gtest/gtest.h>

#include "graph/util/ScopedTimer.h"
#include "common/time/ScopedTimer.h"

namespace nebula {

Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/Executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "common/base/ObjectPool.h"
#include "common/memory/MemoryUtils.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/ExecutionContext.h"
#include "graph/context/QueryContext.h"
#include "graph/executor/ExecutionError.h"
Expand Down Expand Up @@ -97,7 +98,6 @@
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Query.h"
#include "graph/service/GraphFlags.h"
#include "graph/util/ScopedTimer.h"
#include "interface/gen-cpp2/graph_types.h"

using folly::stringPrintf;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "common/cpp/helpers.h"
#include "common/datatypes/Value.h"
#include "common/time/Duration.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/ExecutionContext.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/CharsetExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "graph/executor/admin/CharsetExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/ConfigExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/conf/Configuration.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/GroupExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "graph/executor/admin/GroupExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/PartExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "graph/executor/admin/PartExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

using nebula::network::NetworkUtils;

Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/ShowHostsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/ShowMetaLeaderExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/time/ScopedTimer.h"
#include "common/time/TimeUtils.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/ShowQueriesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/time/ScopedTimer.h"
#include "common/time/TimeUtils.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/ShowStatsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

#include "graph/executor/admin/ShowStatsExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/SnapshotExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/SpaceExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

#include "graph/executor/admin/SpaceExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"
#include "graph/util/FTIndexUtils.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/SubmitJobExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/time/ScopedTimer.h"
#include "common/time/TimeUtils.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/SwitchSpaceExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include "graph/executor/admin/SwitchSpaceExecutor.h"

#include "clients/meta/MetaClient.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Query.h"
#include "graph/service/PermissionManager.h"
#include "graph/util/ScopedTimer.h"
#include "interface/gen-cpp2/meta_types.h"

namespace nebula {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/admin/ZoneExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "graph/executor/admin/ZoneExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/logic/LoopExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

#include <folly/String.h>

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/planner/plan/Logic.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"
#include "interface/gen-cpp2/common_types.h"

using folly::stringPrintf;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/logic/PassThroughExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "graph/executor/logic/PassThroughExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/logic/SelectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include "graph/executor/logic/SelectExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/planner/plan/Logic.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/logic/StartExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "graph/executor/logic/StartExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/maintain/EdgeExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include "graph/executor/maintain/EdgeExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Maintain.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/maintain/TagExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include "graph/executor/maintain/TagExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Maintain.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/mutate/DeleteExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

#include "DeleteExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/executor/mutate/DeleteExecutor.h"
#include "graph/planner/plan/Mutate.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

using nebula::storage::GraphStorageClient;

Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/mutate/InsertExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include "graph/executor/mutate/InsertExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Mutate.h"
#include "graph/service/GraphFlags.h"
#include "graph/util/ScopedTimer.h"

using nebula::storage::GraphStorageClient;

Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/mutate/UpdateExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

#include "UpdateExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Mutate.h"
#include "graph/service/GraphFlags.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

using nebula::storage::GraphStorageClient;

Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/AggregateExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

#include "common/datatypes/List.h"
#include "common/expression/AggregateExpression.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/context/Result.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/DataCollectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "graph/executor/query/DataCollectExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/DedupExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "graph/executor/query/DedupExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/FilterExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "graph/executor/query/FilterExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ScopedTimer.h"

namespace nebula {
namespace graph {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/GetEdgesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include "graph/executor/query/GetEdgesExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

using nebula::storage::GraphStorageClient;
using nebula::storage::StorageRpcResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/GetNeighborsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "clients/storage/GraphStorageClient.h"
#include "common/datatypes/List.h"
#include "common/datatypes/Vertex.h"
#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/service/GraphFlags.h"
#include "graph/util/ScopedTimer.h"

using nebula::storage::GraphStorageClient;
using nebula::storage::StorageRpcResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/query/GetVerticesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "graph/executor/query/GetVerticesExecutor.h"

#include "common/time/ScopedTimer.h"
#include "graph/context/QueryContext.h"
#include "graph/util/SchemaUtil.h"
#include "graph/util/ScopedTimer.h"

using nebula::storage::GraphStorageClient;
using nebula::storage::StorageRpcResponse;
Expand Down
Loading

0 comments on commit 80f22a8

Please sign in to comment.