diff --git a/src/common/expression/test/CMakeLists.txt b/src/common/expression/test/CMakeLists.txt index 700a4da5f30..09c9e139b58 100644 --- a/src/common/expression/test/CMakeLists.txt +++ b/src/common/expression/test/CMakeLists.txt @@ -9,7 +9,7 @@ set(expression_test_common_libs $ $ $ - $ + $ $ $ $ diff --git a/src/graph/context/test/CMakeLists.txt b/src/graph/context/test/CMakeLists.txt index 4fd9cdcef5c..6b8286bfec0 100644 --- a/src/graph/context/test/CMakeLists.txt +++ b/src/graph/context/test/CMakeLists.txt @@ -42,6 +42,8 @@ SET(CONTEXT_TEST_LIBS $ $ $ + $ + $ ) nebula_add_test( diff --git a/src/graph/optimizer/test/CMakeLists.txt b/src/graph/optimizer/test/CMakeLists.txt index 0f3c0fc72ad..e29af4031e2 100644 --- a/src/graph/optimizer/test/CMakeLists.txt +++ b/src/graph/optimizer/test/CMakeLists.txt @@ -48,6 +48,8 @@ set(OPTIMIZER_TEST_LIB $ $ $ + $ + $ ) nebula_add_test( diff --git a/src/graph/planner/test/CMakeLists.txt b/src/graph/planner/test/CMakeLists.txt index bb45ebd9201..02aa6b5edb0 100644 --- a/src/graph/planner/test/CMakeLists.txt +++ b/src/graph/planner/test/CMakeLists.txt @@ -18,6 +18,7 @@ nebula_add_test( $ $ $ + $ $ $ $ diff --git a/src/graph/session/ClientSession.cpp b/src/graph/session/ClientSession.cpp index 0a3b44c690a..74fa1f6cfbc 100644 --- a/src/graph/session/ClientSession.cpp +++ b/src/graph/session/ClientSession.cpp @@ -77,7 +77,7 @@ void ClientSession::markQueryKilled(nebula::ExecutionPlanID epId) { return; } context->second->markKilled(); - // stats::StatsManager::addValue(kNumKilledQueries); + stats::StatsManager::addValue(kNumKilledQueries); VLOG(1) << "Mark query killed in local cache, epId: " << epId; auto query = session_.queries_ref()->find(epId); @@ -94,7 +94,7 @@ void ClientSession::markAllQueryKilled() { context.second->markKilled(); session_.queries_ref()->clear(); } - // stats::StatsManager::addValue(kNumKilledQueries, contexts_.size()); + stats::StatsManager::addValue(kNumKilledQueries, contexts_.size()); } } // namespace graph } // namespace nebula diff --git a/src/graph/session/GraphSessionManager.cpp b/src/graph/session/GraphSessionManager.cpp index 894545cad61..3d256bac75d 100644 --- a/src/graph/session/GraphSessionManager.cpp +++ b/src/graph/session/GraphSessionManager.cpp @@ -183,8 +183,8 @@ void GraphSessionManager::reclaimExpiredSessions() { LOG(ERROR) << "Remove session `" << iter->first << "' failed: " << resp.status(); } iter = activeSessions_.erase(iter); - // stats::StatsManager::decValue(kNumActiveSessions); - // stats::StatsManager::addValue(kNumReclaimedExpiredSessions); + stats::StatsManager::decValue(kNumActiveSessions); + stats::StatsManager::addValue(kNumReclaimedExpiredSessions); // TODO: Disconnect the connection of the session } } diff --git a/src/graph/stats/StatsDef.cpp b/src/graph/stats/StatsDef.cpp index 4f37bda7673..e3f7fe5f059 100644 --- a/src/graph/stats/StatsDef.cpp +++ b/src/graph/stats/StatsDef.cpp @@ -44,7 +44,7 @@ stats::CounterId kNumReclaimedExpiredSessions; void initCounters() { kNumQueries = stats::StatsManager::registerStats("num_queries", "rate, sum"); - kNumActiveQueries = stats::StatsManager::registerStats("num_active_queries", "rate, sum"); + kNumActiveQueries = stats::StatsManager::registerStats("num_active_queries", "sum"); kNumSlowQueries = stats::StatsManager::registerStats("num_slow_queries", "rate, sum"); kNumSentences = stats::StatsManager::registerStats("num_sentences", "rate, sum"); kNumQueryErrors = stats::StatsManager::registerStats("num_query_errors", "rate, sum"); @@ -78,7 +78,7 @@ void initCounters() { "num_auth_failed_sessions_bad_username_password", "rate, sum"); kNumAuthFailedSessionsOutOfMaxAllowed = stats::StatsManager::registerStats( "num_auth_failed_sessions_out_of_max_allowed", "rate, sum"); - kNumActiveSessions = stats::StatsManager::registerStats("num_active_sessions", "rate, sum"); + kNumActiveSessions = stats::StatsManager::registerStats("num_active_sessions", "sum"); kNumReclaimedExpiredSessions = stats::StatsManager::registerStats("num_reclaimed_expired_sessions", "rate, sum"); } diff --git a/src/graph/util/test/CMakeLists.txt b/src/graph/util/test/CMakeLists.txt index 4e0b0235e0e..7d3031a5b19 100644 --- a/src/graph/util/test/CMakeLists.txt +++ b/src/graph/util/test/CMakeLists.txt @@ -45,6 +45,8 @@ nebula_add_test( $ $ $ + $ + $ LIBRARIES gtest gtest_main diff --git a/src/graph/validator/test/CMakeLists.txt b/src/graph/validator/test/CMakeLists.txt index 0363a74afc5..ab6a41e7fbb 100644 --- a/src/graph/validator/test/CMakeLists.txt +++ b/src/graph/validator/test/CMakeLists.txt @@ -26,6 +26,7 @@ set(VALIDATOR_TEST_LIBS $ $ $ + $ $ $ $ diff --git a/src/graph/visitor/test/CMakeLists.txt b/src/graph/visitor/test/CMakeLists.txt index bbf2e21b564..d84f3d7144a 100644 --- a/src/graph/visitor/test/CMakeLists.txt +++ b/src/graph/visitor/test/CMakeLists.txt @@ -31,6 +31,7 @@ nebula_add_test( $ $ $ + $ $ $ $ diff --git a/src/meta/processors/job/JobManager.cpp b/src/meta/processors/job/JobManager.cpp index ca2c116e719..38f2bff019a 100644 --- a/src/meta/processors/job/JobManager.cpp +++ b/src/meta/processors/job/JobManager.cpp @@ -12,6 +12,7 @@ #include #include "common/http/HttpClient.h" +#include "common/stats/StatsManager.h" #include "common/time/WallClock.h" #include "common/utils/MetaKeyUtils.h" #include "interface/gen-cpp2/common_types.h" @@ -33,6 +34,7 @@ using nebula::kvstore::KVIterator; namespace nebula { namespace meta { +stats::CounterId kNumRunningJobs = stats::StatsManager::registerStats("num_running_jobs", "sum"); JobManager* JobManager::getInstance() { static JobManager inst; diff --git a/src/meta/processors/job/JobManager.h b/src/meta/processors/job/JobManager.h index 8d9a2e8d188..59eac5d2dff 100644 --- a/src/meta/processors/job/JobManager.h +++ b/src/meta/processors/job/JobManager.h @@ -14,6 +14,7 @@ #include "common/base/Base.h" #include "common/base/ErrorOr.h" +#include "common/stats/StatsManager.h" #include "interface/gen-cpp2/meta_types.h" #include "kvstore/NebulaStore.h" #include "meta/processors/job/JobDescription.h" @@ -23,6 +24,7 @@ namespace nebula { namespace meta { +extern stats::CounterId kNumRunningJobs; class JobManager : public nebula::cpp::NonCopyable, public nebula::cpp::NonMovable { friend class JobManagerTest; diff --git a/src/parser/test/CMakeLists.txt b/src/parser/test/CMakeLists.txt index 8a08473f042..c6fc74dfbf6 100644 --- a/src/parser/test/CMakeLists.txt +++ b/src/parser/test/CMakeLists.txt @@ -9,6 +9,7 @@ set(PARSER_TEST_LIBS $ $ $ + $ $ $ $