diff options
author | vjpai <vpai@google.com> | 2015-10-29 01:21:04 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2015-10-29 01:21:04 -0700 |
commit | 119c103ab00f309a66de6f1cb78c648eb3c4e2cc (patch) | |
tree | 2c75fd44bc3cefc53c22121f0601f57b408a569f /test/cpp/qps/server.h | |
parent | 754751e3c60d416beb92938d7d453b23fa57dd7e (diff) |
Split up into a new service proto, use proper service suffix, add a
reset option to the mark, create a closed loop config params (empty
message) for consistency with other tests.
Diffstat (limited to 'test/cpp/qps/server.h')
-rw-r--r-- | test/cpp/qps/server.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h index ba8394badc..c99ef97564 100644 --- a/test/cpp/qps/server.h +++ b/test/cpp/qps/server.h @@ -35,6 +35,7 @@ #define TEST_QPS_SERVER_H #include "test/cpp/qps/timer.h" +#include "test/proto/messages.grpc.pb.h" #include "test/proto/perf_tests/perf_control.grpc.pb.h" namespace grpc { @@ -45,11 +46,15 @@ class Server { Server() : timer_(new Timer) {} virtual ~Server() {} - ServerStats Mark() { - std::unique_ptr<Timer> timer(new Timer); - timer.swap(timer_); - - auto timer_result = timer->Mark(); + ServerStats Mark(bool reset) { + Timer::Result timer_result; + if (reset) { + std::unique_ptr<Timer> timer(new Timer); + timer.swap(timer_); + timer_result = timer->Mark(); + } else { + timer_result = timer_->Mark(); + } ServerStats stats; stats.set_time_elapsed(timer_result.wall); |