Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments for stats module #3908

Merged
merged 2 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/common/stats/StatsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class StatsManager final {
std::vector<StatsMethod> methods,
std::vector<std::pair<std::string, double>> percentiles);

// Dynamically register some stats with label values
static CounterId counterWithLabels(const CounterId& id, const std::vector<LabelPair>& labels);
static CounterId histoWithLabels(const CounterId& id, const std::vector<LabelPair>& labels);

Expand Down Expand Up @@ -166,6 +167,7 @@ class StatsManager final {
StatsManager(const StatsManager&) = delete;
StatsManager(StatsManager&&) = delete;

// Parse percentiles from the string
static bool strToPct(folly::StringPiece part, double& pct);
static void parseStats(const folly::StringPiece stats,
std::vector<StatsMethod>& methods,
Expand Down
2 changes: 2 additions & 0 deletions src/graph/stats/GraphStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ DECLARE_bool(enable_space_level_metrics);
namespace nebula {

// Query
// A sequential sentence is treated as one query
extern stats::CounterId kNumQueries;
extern stats::CounterId kNumActiveQueries;
extern stats::CounterId kNumSlowQueries;
extern stats::CounterId kNumQueryErrors;
extern stats::CounterId kNumQueryErrorsLeaderChanges;
// A sequential sentence is treated as multiple sentences seperated by `;`
extern stats::CounterId kNumSentences;
extern stats::CounterId kQueryLatencyUs;
extern stats::CounterId kSlowQueryLatencyUs;
Expand Down
1 change: 1 addition & 0 deletions src/kvstore/stats/KVStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace nebula {

// Raft related stats
extern stats::CounterId kCommitLogLatencyUs;
extern stats::CounterId kCommitSnapshotLatencyUs;
extern stats::CounterId kTransferLeaderLatencyUs;
Expand Down
1 change: 1 addition & 0 deletions src/storage/http/StorageHttpStatsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void StorageHttpStatsHandler::onError(ProxygenError err) noexcept {
delete this;
}

// Export the stats of rocksdb
folly::dynamic StorageHttpStatsHandler::getStats() const {
auto stats = folly::dynamic::array();
std::shared_ptr<rocksdb::Statistics> statistics = kvstore::getDBStatistics();
Expand Down