diff options
Diffstat (limited to 'test/cpp/microbenchmarks/helpers.cc')
-rw-r--r-- | test/cpp/microbenchmarks/helpers.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index b0caa48cd0..6802a0aa99 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -20,6 +20,9 @@ void TrackCounters::Finish(benchmark::State &state) { std::ostringstream out; + for (const auto &l : labels_) { + out << l << ' '; + } AddToLabel(out, state); std::string label = out.str(); if (label.length() && label[0] == ' ') { @@ -28,6 +31,10 @@ void TrackCounters::Finish(benchmark::State &state) { state.SetLabel(label.c_str()); } +void TrackCounters::AddLabel(const grpc::string &label) { + labels_.push_back(label); +} + void TrackCounters::AddToLabel(std::ostream &out, benchmark::State &state) { grpc_stats_data stats_end; grpc_stats_collect(&stats_end); |