diff options
author | Vijay Pai <vpai@google.com> | 2016-02-02 10:36:12 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-02-02 10:36:12 -0800 |
commit | b47b556d33c0e22601e773cad17d576197b4942b (patch) | |
tree | 96f3900c391a24e27182e00c4bf020a55b4cfdb9 /test/cpp/qps/qps_worker.cc | |
parent | d99ed6b636eca5d7ba38f19337f447aa0fbeebb9 (diff) | |
parent | 71a083b1b14cf6f9844d51e7e7c3b75de16c0501 (diff) |
Merge branch 'master' into worker_quit
Diffstat (limited to 'test/cpp/qps/qps_worker.cc')
-rw-r--r-- | test/cpp/qps/qps_worker.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index 47b51fe3dd..9442017ddf 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> @@ -83,15 +84,10 @@ static std::unique_ptr<Client> CreateClient(const ClientConfig& config) { abort(); } -static void LimitCores(int cores) {} - static std::unique_ptr<Server> CreateServer(const ServerConfig& config) { gpr_log(GPR_INFO, "Starting server of type %s", ServerType_Name(config.server_type()).c_str()); - if (config.core_limit() > 0) { - LimitCores(config.core_limit()); - } switch (config.server_type()) { case ServerType::SYNC_SERVER: return CreateSynchronousServer(config); @@ -138,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; + } + Status QuitWorker(ServerContext* ctx, const Void*, Void*) GRPC_OVERRIDE { InstanceGuard g(this); if (!g.Acquired()) { |