Skip to content

Commit

Permalink
compile pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Dec 14, 2021
1 parent affde11 commit 1b26800
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common/expression/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(expression_test_common_libs
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
$<TARGET_OBJECTS:stats_def_obj>
$<TARGET_OBJECTS:datatypes_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:datetime_parser_obj>
Expand Down
2 changes: 2 additions & 0 deletions src/graph/context/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ SET(CONTEXT_TEST_LIBS
$<TARGET_OBJECTS:idgenerator_obj>
$<TARGET_OBJECTS:ssl_obj>
$<TARGET_OBJECTS:memory_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
)

nebula_add_test(
Expand Down
2 changes: 2 additions & 0 deletions src/graph/optimizer/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ set(OPTIMIZER_TEST_LIB
$<TARGET_OBJECTS:ssl_obj>
$<TARGET_OBJECTS:memory_obj>
$<TARGET_OBJECTS:geo_index_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
)

nebula_add_test(
Expand Down
1 change: 1 addition & 0 deletions src/graph/planner/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ nebula_add_test(
$<TARGET_OBJECTS:storage_thrift_obj>
$<TARGET_OBJECTS:meta_client_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:meta_thrift_obj>
$<TARGET_OBJECTS:common_thrift_obj>
Expand Down
4 changes: 2 additions & 2 deletions src/graph/session/ClientSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
4 changes: 2 additions & 2 deletions src/graph/session/GraphSessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/graph/stats/StatsDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
}
Expand Down
2 changes: 2 additions & 0 deletions src/graph/util/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ nebula_add_test(
$<TARGET_OBJECTS:graph_context_obj>
$<TARGET_OBJECTS:memory_obj>
$<TARGET_OBJECTS:version_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
LIBRARIES
gtest
gtest_main
Expand Down
1 change: 1 addition & 0 deletions src/graph/validator/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set(VALIDATOR_TEST_LIBS
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:common_thrift_obj>
$<TARGET_OBJECTS:graph_thrift_obj>
Expand Down
1 change: 1 addition & 0 deletions src/graph/visitor/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ nebula_add_test(
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:common_thrift_obj>
$<TARGET_OBJECTS:graph_thrift_obj>
Expand Down
2 changes: 2 additions & 0 deletions src/meta/processors/job/JobManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <boost/stacktrace.hpp>

#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"
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/processors/job/JobManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/parser/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(PARSER_TEST_LIBS
$<TARGET_OBJECTS:network_obj>
$<TARGET_OBJECTS:fs_obj>
$<TARGET_OBJECTS:stats_obj>
$<TARGET_OBJECTS:stats_def_obj>
$<TARGET_OBJECTS:time_obj>
$<TARGET_OBJECTS:common_thrift_obj>
$<TARGET_OBJECTS:thrift_obj>
Expand Down

0 comments on commit 1b26800

Please sign in to comment.