aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/server_async.cc
diff options
context:
space:
mode:
authorGravatar Yuxuan Li <yuxuanli@google.com>2017-05-03 22:27:11 -0700
committerGravatar Yuxuan Li <yuxuanli@google.com>2017-05-03 22:27:11 -0700
commit5d3ddeeea1dc88392cfb126ebd5b86185c2d36cc (patch)
tree7794086c5a4a7c06a4fdfacb437af50da60add4c /test/cpp/qps/server_async.cc
parent999ac157e648d6bccdec16a696842bdbf5416e27 (diff)
adding server side poll stat
Diffstat (limited to 'test/cpp/qps/server_async.cc')
-rw-r--r--test/cpp/qps/server_async.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index b499b82091..e503e62204 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -53,6 +53,10 @@
#include "test/core/util/test_config.h"
#include "test/cpp/qps/server.h"
+extern "C" {
+#include "src/core/lib/surface/completion_queue.h"
+}
+
namespace grpc {
namespace testing {
@@ -154,6 +158,16 @@ class AsyncQpsServerTest final : public grpc::testing::Server {
shutdown_thread.join();
}
+ int GetPollCount() {
+ int count = 0;
+ int i = 0;
+ for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); cq++) {
+ int k = (int)grpc_get_cq_poll_num((*cq)->cq());
+ gpr_log(GPR_INFO, "%d: per cq poll:%d", i++, k);
+ count += k;
+ }
+ return count;
+ }
private:
void ShutdownThreadFunc() {
// TODO (vpai): Remove this deadline and allow Shutdown to finish properly