aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps
diff options
context:
space:
mode:
authorGravatar Yuxuan Li <yuxuanli@google.com>2016-11-07 11:43:11 -0800
committerGravatar Yuxuan Li <yuxuanli@google.com>2016-11-07 11:43:11 -0800
commit8114153015271bb0ccd1c92ca95e10a1632294e0 (patch)
treefa194d0351042bad3a1cce46a753f9ea133ae9b2 /test/cpp/qps
parentd68ea95f307d12f2a1398539fb923057aed1f2d1 (diff)
parentb32149461a3e04ae41fee5b414587253582aa435 (diff)
Merge branch 'master' into cpu_usage2
Diffstat (limited to 'test/cpp/qps')
-rw-r--r--test/cpp/qps/client.h2
-rw-r--r--test/cpp/qps/client_async.cc41
-rw-r--r--test/cpp/qps/client_sync.cc10
-rwxr-xr-xtest/cpp/qps/gen_build_yaml.py2
-rw-r--r--test/cpp/qps/interarrival.h6
-rw-r--r--test/cpp/qps/qps_worker.cc20
-rw-r--r--test/cpp/qps/server_async.cc22
-rw-r--r--test/cpp/qps/server_sync.cc8
8 files changed, 53 insertions, 58 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 9983c8a7b0..a8d125ad28 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -113,7 +113,7 @@ class ClientRequestCreator<ByteBuffer> {
}
};
-class HistogramEntry GRPC_FINAL {
+class HistogramEntry final {
public:
HistogramEntry() : value_used_(false), status_used_(false) {}
bool value_used() const { return value_used_; }
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 4d36a6ba42..2ec6a5a23b 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -93,8 +93,8 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
callback_(on_done),
next_issue_(next_issue),
start_req_(start_req) {}
- ~ClientRpcContextUnaryImpl() GRPC_OVERRIDE {}
- void Start(CompletionQueue* cq) GRPC_OVERRIDE {
+ ~ClientRpcContextUnaryImpl() override {}
+ void Start(CompletionQueue* cq) override {
cq_ = cq;
if (!next_issue_) { // ready to issue
RunNextState(true, nullptr);
@@ -102,7 +102,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
alarm_.reset(new Alarm(cq_, next_issue_(), ClientRpcContext::tag(this)));
}
}
- bool RunNextState(bool ok, HistogramEntry* entry) GRPC_OVERRIDE {
+ bool RunNextState(bool ok, HistogramEntry* entry) override {
switch (next_state_) {
case State::READY:
start_ = UsageTimer::Now();
@@ -121,7 +121,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext {
return false;
}
}
- ClientRpcContext* StartNewClone() GRPC_OVERRIDE {
+ ClientRpcContext* StartNewClone() override {
return new ClientRpcContextUnaryImpl(stub_, req_, next_issue_, start_req_,
callback_);
}
@@ -217,7 +217,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
}
return num_threads;
}
- void DestroyMultithreading() GRPC_OVERRIDE GRPC_FINAL {
+ void DestroyMultithreading() override final {
for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
std::lock_guard<std::mutex> lock((*ss)->mutex);
(*ss)->shutdown = true;
@@ -228,8 +228,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
this->EndThreads(); // this needed for resolution
}
- bool ThreadFunc(HistogramEntry* entry,
- size_t thread_idx) GRPC_OVERRIDE GRPC_FINAL {
+ bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override final {
void* got_tag;
bool ok;
@@ -279,7 +278,7 @@ static std::unique_ptr<BenchmarkService::Stub> BenchmarkStubCreator(
return BenchmarkService::NewStub(ch);
}
-class AsyncUnaryClient GRPC_FINAL
+class AsyncUnaryClient final
: public AsyncClient<BenchmarkService::Stub, SimpleRequest> {
public:
explicit AsyncUnaryClient(const ClientConfig& config)
@@ -287,7 +286,7 @@ class AsyncUnaryClient GRPC_FINAL
config, SetupCtx, BenchmarkStubCreator) {
StartThreads(num_async_threads_);
}
- ~AsyncUnaryClient() GRPC_OVERRIDE {}
+ ~AsyncUnaryClient() override {}
private:
static void CheckDone(grpc::Status s, SimpleResponse* response,
@@ -329,13 +328,13 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext {
callback_(on_done),
next_issue_(next_issue),
start_req_(start_req) {}
- ~ClientRpcContextStreamingImpl() GRPC_OVERRIDE {}
- void Start(CompletionQueue* cq) GRPC_OVERRIDE {
+ ~ClientRpcContextStreamingImpl() override {}
+ void Start(CompletionQueue* cq) override {
cq_ = cq;
stream_ = start_req_(stub_, &context_, cq, ClientRpcContext::tag(this));
next_state_ = State::STREAM_IDLE;
}
- bool RunNextState(bool ok, HistogramEntry* entry) GRPC_OVERRIDE {
+ bool RunNextState(bool ok, HistogramEntry* entry) override {
while (true) {
switch (next_state_) {
case State::STREAM_IDLE:
@@ -377,7 +376,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext {
}
}
}
- ClientRpcContext* StartNewClone() GRPC_OVERRIDE {
+ ClientRpcContext* StartNewClone() override {
return new ClientRpcContextStreamingImpl(stub_, req_, next_issue_,
start_req_, callback_);
}
@@ -410,7 +409,7 @@ class ClientRpcContextStreamingImpl : public ClientRpcContext {
stream_;
};
-class AsyncStreamingClient GRPC_FINAL
+class AsyncStreamingClient final
: public AsyncClient<BenchmarkService::Stub, SimpleRequest> {
public:
explicit AsyncStreamingClient(const ClientConfig& config)
@@ -419,7 +418,7 @@ class AsyncStreamingClient GRPC_FINAL
StartThreads(num_async_threads_);
}
- ~AsyncStreamingClient() GRPC_OVERRIDE {}
+ ~AsyncStreamingClient() override {}
private:
static void CheckDone(grpc::Status s, SimpleResponse* response) {}
@@ -458,8 +457,8 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
callback_(on_done),
next_issue_(next_issue),
start_req_(start_req) {}
- ~ClientRpcContextGenericStreamingImpl() GRPC_OVERRIDE {}
- void Start(CompletionQueue* cq) GRPC_OVERRIDE {
+ ~ClientRpcContextGenericStreamingImpl() override {}
+ void Start(CompletionQueue* cq) override {
cq_ = cq;
const grpc::string kMethodName(
"/grpc.testing.BenchmarkService/StreamingCall");
@@ -467,7 +466,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
ClientRpcContext::tag(this));
next_state_ = State::STREAM_IDLE;
}
- bool RunNextState(bool ok, HistogramEntry* entry) GRPC_OVERRIDE {
+ bool RunNextState(bool ok, HistogramEntry* entry) override {
while (true) {
switch (next_state_) {
case State::STREAM_IDLE:
@@ -509,7 +508,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
}
}
}
- ClientRpcContext* StartNewClone() GRPC_OVERRIDE {
+ ClientRpcContext* StartNewClone() override {
return new ClientRpcContextGenericStreamingImpl(stub_, req_, next_issue_,
start_req_, callback_);
}
@@ -546,7 +545,7 @@ static std::unique_ptr<grpc::GenericStub> GenericStubCreator(
return std::unique_ptr<grpc::GenericStub>(new grpc::GenericStub(ch));
}
-class GenericAsyncStreamingClient GRPC_FINAL
+class GenericAsyncStreamingClient final
: public AsyncClient<grpc::GenericStub, ByteBuffer> {
public:
explicit GenericAsyncStreamingClient(const ClientConfig& config)
@@ -555,7 +554,7 @@ class GenericAsyncStreamingClient GRPC_FINAL
StartThreads(num_async_threads_);
}
- ~GenericAsyncStreamingClient() GRPC_OVERRIDE {}
+ ~GenericAsyncStreamingClient() override {}
private:
static void CheckDone(grpc::Status s, ByteBuffer* response) {}
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc
index f61e80d76b..a88a24d89c 100644
--- a/test/cpp/qps/client_sync.cc
+++ b/test/cpp/qps/client_sync.cc
@@ -108,10 +108,10 @@ class SynchronousClient
std::vector<SimpleResponse> responses_;
private:
- void DestroyMultithreading() GRPC_OVERRIDE GRPC_FINAL { EndThreads(); }
+ void DestroyMultithreading() override final { EndThreads(); }
};
-class SynchronousUnaryClient GRPC_FINAL : public SynchronousClient {
+class SynchronousUnaryClient final : public SynchronousClient {
public:
SynchronousUnaryClient(const ClientConfig& config)
: SynchronousClient(config) {
@@ -119,7 +119,7 @@ class SynchronousUnaryClient GRPC_FINAL : public SynchronousClient {
}
~SynchronousUnaryClient() {}
- bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) GRPC_OVERRIDE {
+ bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
if (!WaitToIssue(thread_idx)) {
return true;
}
@@ -135,7 +135,7 @@ class SynchronousUnaryClient GRPC_FINAL : public SynchronousClient {
}
};
-class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient {
+class SynchronousStreamingClient final : public SynchronousClient {
public:
SynchronousStreamingClient(const ClientConfig& config)
: SynchronousClient(config) {
@@ -165,7 +165,7 @@ class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient {
delete[] context_;
}
- bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) GRPC_OVERRIDE {
+ bool ThreadFunc(HistogramEntry* entry, size_t thread_idx) override {
if (!WaitToIssue(thread_idx)) {
return true;
}
diff --git a/test/cpp/qps/gen_build_yaml.py b/test/cpp/qps/gen_build_yaml.py
index 369da2c8ca..e4d9e7ac58 100755
--- a/test/cpp/qps/gen_build_yaml.py
+++ b/test/cpp/qps/gen_build_yaml.py
@@ -82,7 +82,7 @@ print yaml.dump({
'defaults': 'boringssl',
'cpu_cost': guess_cpu(scenario_json),
'exclude_configs': [],
- 'timeout_seconds': 3*60
+ 'timeout_seconds': 6*60
}
for scenario_json in scenario_config.CXXLanguage().scenarios()
if 'scalable' in scenario_json.get('CATEGORIES', [])
diff --git a/test/cpp/qps/interarrival.h b/test/cpp/qps/interarrival.h
index 0980d5e8ba..4bef06f566 100644
--- a/test/cpp/qps/interarrival.h
+++ b/test/cpp/qps/interarrival.h
@@ -69,11 +69,11 @@ inline RandomDistInterface::~RandomDistInterface() {}
// independent identical stationary sources. For more information,
// see http://en.wikipedia.org/wiki/Exponential_distribution
-class ExpDist GRPC_FINAL : public RandomDistInterface {
+class ExpDist final : public RandomDistInterface {
public:
explicit ExpDist(double lambda) : lambda_recip_(1.0 / lambda) {}
- ~ExpDist() GRPC_OVERRIDE {}
- double transform(double uni) const GRPC_OVERRIDE {
+ ~ExpDist() override {}
+ double transform(double uni) const override {
// Note: Use 1.0-uni above to avoid NaN if uni is 0
return lambda_recip_ * (-log(1.0 - uni));
}
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index d3e53fe14a..d437920e68 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -100,7 +100,7 @@ static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
abort();
}
-class ScopedProfile GRPC_FINAL {
+class ScopedProfile final {
public:
ScopedProfile(const char* filename, bool enable) : enable_(enable) {
if (enable_) grpc_profiler_start(filename);
@@ -113,14 +113,14 @@ class ScopedProfile GRPC_FINAL {
const bool enable_;
};
-class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
+class WorkerServiceImpl final : public WorkerService::Service {
public:
WorkerServiceImpl(int server_port, QpsWorker* worker)
: acquired_(false), server_port_(server_port), worker_(worker) {}
- Status RunClient(ServerContext* ctx,
- ServerReaderWriter<ClientStatus, ClientArgs>* stream)
- GRPC_OVERRIDE {
+ Status RunClient(
+ ServerContext* ctx,
+ ServerReaderWriter<ClientStatus, ClientArgs>* stream) override {
InstanceGuard g(this);
if (!g.Acquired()) {
return Status(StatusCode::RESOURCE_EXHAUSTED, "Client worker busy");
@@ -132,9 +132,9 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
return ret;
}
- Status RunServer(ServerContext* ctx,
- ServerReaderWriter<ServerStatus, ServerArgs>* stream)
- GRPC_OVERRIDE {
+ Status RunServer(
+ ServerContext* ctx,
+ ServerReaderWriter<ServerStatus, ServerArgs>* stream) override {
InstanceGuard g(this);
if (!g.Acquired()) {
return Status(StatusCode::RESOURCE_EXHAUSTED, "Server worker busy");
@@ -147,12 +147,12 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
}
Status CoreCount(ServerContext* ctx, const CoreRequest*,
- CoreResponse* resp) GRPC_OVERRIDE {
+ CoreResponse* resp) override {
resp->set_cores(gpr_cpu_num_cores());
return Status::OK;
}
- Status QuitWorker(ServerContext* ctx, const Void*, Void*) GRPC_OVERRIDE {
+ Status QuitWorker(ServerContext* ctx, const Void*, Void*) override {
InstanceGuard g(this);
if (!g.Acquired()) {
return Status(StatusCode::RESOURCE_EXHAUSTED, "Quitting worker busy");
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index bc4c896d83..f556fbdfa1 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -58,7 +58,7 @@ namespace testing {
template <class RequestType, class ResponseType, class ServiceType,
class ServerContextType>
-class AsyncQpsServerTest GRPC_FINAL : public grpc::testing::Server {
+class AsyncQpsServerTest final : public grpc::testing::Server {
public:
AsyncQpsServerTest(
const ServerConfig &config,
@@ -196,7 +196,7 @@ class AsyncQpsServerTest GRPC_FINAL : public grpc::testing::Server {
return reinterpret_cast<ServerRpcContext *>(tag);
}
- class ServerRpcContextUnaryImpl GRPC_FINAL : public ServerRpcContext {
+ class ServerRpcContextUnaryImpl final : public ServerRpcContext {
public:
ServerRpcContextUnaryImpl(
std::function<void(ServerContextType *, RequestType *,
@@ -213,11 +213,9 @@ class AsyncQpsServerTest GRPC_FINAL : public grpc::testing::Server {
request_method_(srv_ctx_.get(), &req_, &response_writer_,
AsyncQpsServerTest::tag(this));
}
- ~ServerRpcContextUnaryImpl() GRPC_OVERRIDE {}
- bool RunNextState(bool ok) GRPC_OVERRIDE {
- return (this->*next_state_)(ok);
- }
- void Reset() GRPC_OVERRIDE {
+ ~ServerRpcContextUnaryImpl() override {}
+ bool RunNextState(bool ok) override { return (this->*next_state_)(ok); }
+ void Reset() override {
srv_ctx_.reset(new ServerContextType);
req_ = RequestType();
response_writer_ =
@@ -257,7 +255,7 @@ class AsyncQpsServerTest GRPC_FINAL : public grpc::testing::Server {
grpc::ServerAsyncResponseWriter<ResponseType> response_writer_;
};
- class ServerRpcContextStreamingImpl GRPC_FINAL : public ServerRpcContext {
+ class ServerRpcContextStreamingImpl final : public ServerRpcContext {
public:
ServerRpcContextStreamingImpl(
std::function<void(
@@ -273,11 +271,9 @@ class AsyncQpsServerTest GRPC_FINAL : public grpc::testing::Server {
stream_(srv_ctx_.get()) {
request_method_(srv_ctx_.get(), &stream_, AsyncQpsServerTest::tag(this));
}
- ~ServerRpcContextStreamingImpl() GRPC_OVERRIDE {}
- bool RunNextState(bool ok) GRPC_OVERRIDE {
- return (this->*next_state_)(ok);
- }
- void Reset() GRPC_OVERRIDE {
+ ~ServerRpcContextStreamingImpl() override {}
+ bool RunNextState(bool ok) override { return (this->*next_state_)(ok); }
+ void Reset() override {
srv_ctx_.reset(new ServerContextType);
req_ = RequestType();
stream_ = grpc::ServerAsyncReaderWriter<ResponseType, RequestType>(
diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc
index 07f48e2644..8076a4a6b9 100644
--- a/test/cpp/qps/server_sync.cc
+++ b/test/cpp/qps/server_sync.cc
@@ -48,10 +48,10 @@
namespace grpc {
namespace testing {
-class BenchmarkServiceImpl GRPC_FINAL : public BenchmarkService::Service {
+class BenchmarkServiceImpl final : public BenchmarkService::Service {
public:
Status UnaryCall(ServerContext* context, const SimpleRequest* request,
- SimpleResponse* response) GRPC_OVERRIDE {
+ SimpleResponse* response) override {
if (request->response_size() > 0) {
if (!Server::SetPayload(request->response_type(),
request->response_size(),
@@ -63,7 +63,7 @@ class BenchmarkServiceImpl GRPC_FINAL : public BenchmarkService::Service {
}
Status StreamingCall(
ServerContext* context,
- ServerReaderWriter<SimpleResponse, SimpleRequest>* stream) GRPC_OVERRIDE {
+ ServerReaderWriter<SimpleResponse, SimpleRequest>* stream) override {
SimpleRequest request;
while (stream->Read(&request)) {
SimpleResponse response;
@@ -80,7 +80,7 @@ class BenchmarkServiceImpl GRPC_FINAL : public BenchmarkService::Service {
}
};
-class SynchronousServer GRPC_FINAL : public grpc::testing::Server {
+class SynchronousServer final : public grpc::testing::Server {
public:
explicit SynchronousServer(const ServerConfig& config) : Server(config) {
ServerBuilder builder;