diff options
author | 2016-02-10 14:55:33 -0800 | |
---|---|---|
committer | 2016-02-10 14:55:33 -0800 | |
commit | 9982c6fc3a9bf435c963a057fcc853fec8c48e5e (patch) | |
tree | 238f31b72e613a2b16d640f60f17be92802a47f9 /test/cpp/qps/qps_interarrival_test.cc | |
parent | 42fad8e765b8bbdd2211dc2e0172a9565d395cc8 (diff) |
Fix random number generators and improve code style (stop using
operator overloads)
Diffstat (limited to 'test/cpp/qps/qps_interarrival_test.cc')
-rw-r--r-- | test/cpp/qps/qps_interarrival_test.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/cpp/qps/qps_interarrival_test.cc b/test/cpp/qps/qps_interarrival_test.cc index ccda28f09a..dd32bcc0e3 100644 --- a/test/cpp/qps/qps_interarrival_test.cc +++ b/test/cpp/qps/qps_interarrival_test.cc @@ -39,17 +39,17 @@ #include "test/cpp/qps/interarrival.h" -using grpc::testing::RandomDist; +using grpc::testing::RandomDistInterface; using grpc::testing::InterarrivalTimer; -static void RunTest(RandomDist &&r, int threads, std::string title) { +static void RunTest(RandomDistInterface &&r, int threads, std::string title) { InterarrivalTimer timer; timer.init(r, threads); gpr_histogram *h(gpr_histogram_create(0.01, 60e9)); for (int i = 0; i < 10000000; i++) { for (int j = 0; j < threads; j++) { - gpr_histogram_add(h, timer(j).count()); + gpr_histogram_add(h, timer.next(j).count()); } } @@ -70,7 +70,7 @@ using grpc::testing::ParetoDist; int main(int argc, char **argv) { RunTest(ExpDist(10.0), 5, std::string("Exponential(10)")); RunTest(DetDist(5.0), 5, std::string("Det(5)")); - RunTest(UniformDist(0.0, 10.0), 5, std::string("Uniform(1,10)")); + RunTest(UniformDist(0.0, 10.0), 5, std::string("Uniform(0,10)")); RunTest(ParetoDist(1.0, 1.0), 5, std::string("Pareto(1,1)")); return 0; } |