diff options
author | vjpai <vpai@google.com> | 2015-05-28 10:09:32 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2015-05-28 10:09:32 -0700 |
commit | 675140ca1d394f564f2156add8a1a18a2dc132b7 (patch) | |
tree | 78fd267e9b416c1ef00514052b54b93ecdbdb4d1 /test/cpp/qps/client_sync.cc | |
parent | efad2ae67478ca70c064683af42c7f4bcfca5908 (diff) | |
parent | 5e9757bf0f8ada75068038c3e29d8b1e875d2ce3 (diff) |
Merge branch 'master' into poisson
Conflicts:
Makefile
test/cpp/qps/client_async.cc
test/cpp/qps/qpstest.proto
Diffstat (limited to 'test/cpp/qps/client_sync.cc')
-rw-r--r-- | test/cpp/qps/client_sync.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index 6a89c5acc2..98297d3abb 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -110,7 +110,9 @@ class SynchronousUnaryClient GRPC_FINAL : public SynchronousClient { class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { public: SynchronousStreamingClient(const ClientConfig& config) - : SynchronousClient(config), context_(num_threads_), stream_(num_threads_) { + : SynchronousClient(config), + context_(num_threads_), + stream_(num_threads_) { for (size_t thread_idx = 0; thread_idx < num_threads_; thread_idx++) { auto* stub = channels_[thread_idx % channels_.size()].get_stub(); stream_[thread_idx] = stub->StreamingCall(&context_[thread_idx]); @@ -121,8 +123,8 @@ class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { EndThreads(); for (auto stream = stream_.begin(); stream != stream_.end(); stream++) { if (*stream) { - (*stream)->WritesDone(); - EXPECT_TRUE((*stream)->Finish().IsOk()); + (*stream)->WritesDone(); + EXPECT_TRUE((*stream)->Finish().IsOk()); } } } @@ -131,7 +133,7 @@ class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { WaitToIssue(thread_idx); double start = Timer::Now(); if (stream_[thread_idx]->Write(request_) && - stream_[thread_idx]->Read(&responses_[thread_idx])) { + stream_[thread_idx]->Read(&responses_[thread_idx])) { histogram->Add((Timer::Now() - start) * 1e9); return true; } @@ -140,8 +142,8 @@ class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { private: std::vector<grpc::ClientContext> context_; - std::vector<std::unique_ptr<grpc::ClientReaderWriter< - SimpleRequest, SimpleResponse>>> stream_; + std::vector<std::unique_ptr< + grpc::ClientReaderWriter<SimpleRequest, SimpleResponse>>> stream_; }; std::unique_ptr<Client> CreateSynchronousUnaryClient( |