|
|
|
@ -16,6 +16,8 @@ |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
|
#include "test/cpp/microbenchmarks/helpers.h" |
|
|
|
|
|
|
|
|
|
void TrackCounters::Finish(benchmark::State &state) { |
|
|
|
@ -45,10 +47,14 @@ void TrackCounters::AddToLabel(std::ostream &out, benchmark::State &state) { |
|
|
|
|
<< "/iter:" << ((double)stats.counters[i] / (double)state.iterations()); |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < GRPC_STATS_HISTOGRAM_COUNT; i++) { |
|
|
|
|
out << " " << grpc_stats_histogram_name[i] << "-median:" |
|
|
|
|
<< grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 50.0) |
|
|
|
|
<< " " << grpc_stats_histogram_name[i] << "-99p:" |
|
|
|
|
<< grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 99.0); |
|
|
|
|
std::ostringstream median_ss; |
|
|
|
|
median_ss << grpc_stats_histogram_name[i] << "-median"; |
|
|
|
|
state.counters[median_ss.str()] = benchmark::Counter( |
|
|
|
|
grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 50.0)); |
|
|
|
|
std::ostringstream tail_ss; |
|
|
|
|
tail_ss << grpc_stats_histogram_name[i] << "-99p"; |
|
|
|
|
state.counters[tail_ss.str()] = benchmark::Counter( |
|
|
|
|
grpc_stats_histo_percentile(&stats, (grpc_stats_histograms)i, 99.0)); |
|
|
|
|
} |
|
|
|
|
#ifdef GPR_LOW_LEVEL_COUNTERS |
|
|
|
|
grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot(); |
|
|
|
|