From 373fc6dc40a7d12bb257d67188ca3aa3c997d8a6 Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Thu, 7 Jun 2018 22:52:23 -0700 Subject: Manual fixes to enable performance- clang tidy checks --- test/cpp/qps/client.h | 2 +- test/cpp/qps/client_async.cc | 14 +++++++------- test/cpp/qps/client_sync.cc | 2 +- test/cpp/qps/driver.cc | 1 - 4 files changed, 9 insertions(+), 10 deletions(-) (limited to 'test/cpp/qps') diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 31ae6ca1fb..9d58ea8882 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -450,7 +450,7 @@ class ClientImpl : public Client { private: void set_channel_args(const ClientConfig& config, ChannelArguments* args) { - for (auto channel_arg : config.channel_args()) { + for (const auto& channel_arg : config.channel_args()) { if (channel_arg.value_case() == ChannelArg::kStrValue) { args->SetString(channel_arg.name(), channel_arg.str_value()); } else if (channel_arg.value_case() == ChannelArg::kIntValue) { diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index e6dbb7e076..bad24cf04a 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -299,7 +299,7 @@ class AsyncClient : public ClientImpl { }; static std::unique_ptr BenchmarkStubCreator( - std::shared_ptr ch) { + const std::shared_ptr& ch) { return BenchmarkService::NewStub(ch); } @@ -314,7 +314,7 @@ class AsyncUnaryClient final ~AsyncUnaryClient() override {} private: - static void CheckDone(grpc::Status s, SimpleResponse* response, + static void CheckDone(const grpc::Status& s, SimpleResponse* response, HistogramEntry* entry) { entry->set_status(s.error_code()); } @@ -498,7 +498,7 @@ class AsyncStreamingPingPongClient final ~AsyncStreamingPingPongClient() override {} private: - static void CheckDone(grpc::Status s, SimpleResponse* response) {} + static void CheckDone(const grpc::Status& s, SimpleResponse* response) {} static std::unique_ptr< grpc::ClientAsyncReaderWriter> PrepareReq(BenchmarkService::Stub* stub, grpc::ClientContext* ctx, @@ -630,7 +630,7 @@ class AsyncStreamingFromClientClient final ~AsyncStreamingFromClientClient() override {} private: - static void CheckDone(grpc::Status s, SimpleResponse* response) {} + static void CheckDone(const grpc::Status& s, SimpleResponse* response) {} static std::unique_ptr> PrepareReq( BenchmarkService::Stub* stub, grpc::ClientContext* ctx, SimpleResponse* resp, CompletionQueue* cq) { @@ -745,7 +745,7 @@ class AsyncStreamingFromServerClient final ~AsyncStreamingFromServerClient() override {} private: - static void CheckDone(grpc::Status s, SimpleResponse* response) {} + static void CheckDone(const grpc::Status& s, SimpleResponse* response) {} static std::unique_ptr> PrepareReq( BenchmarkService::Stub* stub, grpc::ClientContext* ctx, const SimpleRequest& req, CompletionQueue* cq) { @@ -895,7 +895,7 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext { }; static std::unique_ptr GenericStubCreator( - std::shared_ptr ch) { + const std::shared_ptr& ch) { return std::unique_ptr(new grpc::GenericStub(ch)); } @@ -911,7 +911,7 @@ class GenericAsyncStreamingClient final ~GenericAsyncStreamingClient() override {} private: - static void CheckDone(grpc::Status s, ByteBuffer* response) {} + static void CheckDone(const grpc::Status& s, ByteBuffer* response) {} static std::unique_ptr PrepareReq( grpc::GenericStub* stub, grpc::ClientContext* ctx, const grpc::string& method_name, CompletionQueue* cq) { diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index 3a60c57e1d..668d9abf5c 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -44,7 +44,7 @@ namespace grpc { namespace testing { static std::unique_ptr BenchmarkStubCreator( - std::shared_ptr ch) { + const std::shared_ptr& ch) { return BenchmarkService::NewStub(ch); } diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index ecf5860b93..cabbd51843 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -217,7 +217,6 @@ std::unique_ptr RunScenario( // To be added to the result, containing the final configuration used for // client and config (including host, etc.) ClientConfig result_client_config; - const ServerConfig& result_server_config = initial_server_config; // Get client, server lists; ignore if inproc test auto workers = (!run_inproc) ? get_workers("QPS_WORKERS") : deque(); -- cgit v1.2.3