diff options
author | Hope Casey-Allen <hcaseyal@google.com> | 2018-08-23 15:14:51 -0700 |
---|---|---|
committer | Hope Casey-Allen <hcaseyal@google.com> | 2018-08-25 18:33:11 -0700 |
commit | 839a0520a2d53a220103aed68bbbe95dfd3aba05 (patch) | |
tree | 20c24ebd2ec23018850609b5cd93c8f0f7d2b2b5 /test/cpp/qps/histogram.h | |
parent | 98fd5a73c3bf1aa285f58932e76bfeaaf5766786 (diff) |
Add an option to collect medians every epoch. Useful for gathering per second median latencies
Diffstat (limited to 'test/cpp/qps/histogram.h')
-rw-r--r-- | test/cpp/qps/histogram.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/cpp/qps/histogram.h b/test/cpp/qps/histogram.h index ba72b5b332..6275128f34 100644 --- a/test/cpp/qps/histogram.h +++ b/test/cpp/qps/histogram.h @@ -34,6 +34,11 @@ class Histogram { ~Histogram() { if (impl_) grpc_histogram_destroy(impl_); } + void Reset() { + if (impl_) grpc_histogram_destroy(impl_); + impl_ = grpc_histogram_create(default_resolution(), default_max_possible()); + } + Histogram(Histogram&& other) : impl_(other.impl_) { other.impl_ = nullptr; } void Merge(const Histogram& h) { grpc_histogram_merge(impl_, h.impl_); } |