aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/histogram.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/qps/histogram.h')
-rw-r--r--test/cpp/qps/histogram.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/cpp/qps/histogram.h b/test/cpp/qps/histogram.h
index 35527d2a2c..b45c769a77 100644
--- a/test/cpp/qps/histogram.h
+++ b/test/cpp/qps/histogram.h
@@ -42,7 +42,9 @@ namespace testing {
class Histogram {
public:
- Histogram() : impl_(gpr_histogram_create(0.01, 60e9)) {}
+ // TODO: look into making histogram params not hardcoded for C++
+ Histogram() : impl_(gpr_histogram_create(default_resolution(),
+ default_max_possible())) {}
~Histogram() {
if (impl_) gpr_histogram_destroy(impl_);
}
@@ -73,6 +75,9 @@ class Histogram {
p.sum_of_squares(), p.count());
}
+ static double default_resolution() { return 0.01; }
+ static double default_max_possible() { return 60e9; }
+
private:
Histogram(const Histogram&);
Histogram& operator=(const Histogram&);