aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/qps_worker.cc
diff options
context:
space:
mode:
authorGravatar vjpai <vpai@google.com>2015-10-29 01:21:04 -0700
committerGravatar vjpai <vpai@google.com>2015-10-29 01:21:04 -0700
commit119c103ab00f309a66de6f1cb78c648eb3c4e2cc (patch)
tree2c75fd44bc3cefc53c22121f0601f57b408a569f /test/cpp/qps/qps_worker.cc
parent754751e3c60d416beb92938d7d453b23fa57dd7e (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/qps_worker.cc')
-rw-r--r--test/cpp/qps/qps_worker.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index f16740b18d..76b4c9b875 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -52,10 +52,10 @@
#include <grpc++/security/server_credentials.h>
#include "test/core/util/grpc_profiler.h"
-#include "test/proto/perf_tests/perf_control.pb.h"
#include "test/cpp/qps/client.h"
#include "test/cpp/qps/server.h"
#include "test/cpp/util/create_test_channel.h"
+#include "test/proto/perf_tests/perf_services.pb.h"
namespace grpc {
namespace testing {
@@ -89,9 +89,9 @@ std::unique_ptr<Server> CreateServer(const ServerConfig& config,
abort();
}
-class WorkerImpl GRPC_FINAL : public Worker::Service {
+class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
public:
- explicit WorkerImpl(int server_port)
+ explicit WorkerServiceImpl(int server_port)
: server_port_(server_port), acquired_(false) {}
Status RunClient(ServerContext* ctx,
@@ -126,7 +126,7 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
// Protect against multiple clients using this worker at once.
class InstanceGuard {
public:
- InstanceGuard(WorkerImpl* impl)
+ InstanceGuard(WorkerServiceImpl* impl)
: impl_(impl), acquired_(impl->TryAcquireInstance()) {}
~InstanceGuard() {
if (acquired_) {
@@ -137,7 +137,7 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
bool Acquired() const { return acquired_; }
private:
- WorkerImpl* const impl_;
+ WorkerServiceImpl* const impl_;
const bool acquired_;
};
@@ -175,7 +175,7 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
if (!args.has_mark()) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
- *status.mutable_stats() = client->Mark();
+ *status.mutable_stats() = client->Mark(args.mark().reset());
stream->Write(status);
}
@@ -204,7 +204,7 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
if (!args.has_mark()) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
- *status.mutable_stats() = server->Mark();
+ *status.mutable_stats() = server->Mark(args.mark().reset());
stream->Write(status);
}
@@ -218,7 +218,7 @@ class WorkerImpl GRPC_FINAL : public Worker::Service {
};
QpsWorker::QpsWorker(int driver_port, int server_port) {
- impl_.reset(new WorkerImpl(server_port));
+ impl_.reset(new WorkerServiceImpl(server_port));
char* server_address = NULL;
gpr_join_host_port(&server_address, "::", driver_port);