Skip to content

Commit

Permalink
Add fetchMetrics API to BaseStatsReporter
Browse files Browse the repository at this point in the history
  • Loading branch information
majetideepak committed Jun 13, 2024
1 parent 08e0b30 commit 22ecbe6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions velox/common/base/StatsReporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ class BaseStatsReporter {
virtual void addHistogramMetricValue(folly::StringPiece key, size_t value)
const = 0;

/// Return the metrics in a serialized string format.
virtual std::string fetchMetrics() const = 0;

static bool registered;
};

Expand Down Expand Up @@ -179,6 +182,8 @@ class DummyStatsReporter : public BaseStatsReporter {

void addHistogramMetricValue(folly::StringPiece /* key */, size_t /* value */)
const override {}

std::string fetchMetrics() const override { return ""; }
};

#define DEFINE_METRIC(key, type) \
Expand Down

0 comments on commit 22ecbe6

Please sign in to comment.