aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/qps_worker.cc
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-02-01 13:00:19 -0800
committerGravatar Vijay Pai <vpai@google.com>2016-02-01 13:00:19 -0800
commit7d45cdb60b1f6f9cd8750f405d74362600b82c16 (patch)
tree2c0f775effed45216f30e697fc3c5b55f93414bc /test/cpp/qps/qps_worker.cc
parentc5eec2be89bb201f84b7278da5522a205dc3620b (diff)
Enable properly working core limits on clients and servers,
and determine these dynamically if only one or the other is specified but both are running on the same host
Diffstat (limited to 'test/cpp/qps/qps_worker.cc')
-rw-r--r--test/cpp/qps/qps_worker.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index 6289c1a843..d0adbb1a54 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -47,6 +47,7 @@
#include <grpc++/server_builder.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
+#include <grpc/support/cpu.h>
#include <grpc/support/histogram.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
@@ -133,6 +134,12 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
return ret;
}
+ Status CoreCount(ServerContext *ctx, const CoreRequest*,
+ CoreResponse* resp) GRPC_OVERRIDE {
+ resp->set_cores(gpr_cpu_num_cores());
+ return Status::OK;
+ }
+
private:
// Protect against multiple clients using this worker at once.
class InstanceGuard {