diff options
author | Yang Gao <yangg@google.com> | 2016-01-13 12:48:56 -0800 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2016-01-13 12:48:56 -0800 |
commit | 16a7dee6141785092ee2aae4a11d2e9f590a1847 (patch) | |
tree | c1136c5f214dde3707a5ef4867f5957801236baa /test/cpp/qps/client_sync.cc | |
parent | 7149ca6bd0ce73a08fa512415d3f641a06a15a75 (diff) | |
parent | 70a043855e2a01d8281b364b71cf35c5b89868da (diff) |
Merge pull request #4670 from vjpai/bbuf
Support generic (non-proto) performance testing
Diffstat (limited to 'test/cpp/qps/client_sync.cc')
-rw-r--r-- | test/cpp/qps/client_sync.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index 9e94f43e35..54cdf390d7 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -35,38 +35,44 @@ #include <chrono> #include <memory> #include <mutex> +#include <sstream> #include <string> #include <thread> #include <vector> -#include <sstream> #include <gflags/gflags.h> +#include <grpc++/client_context.h> +#include <grpc++/server.h> +#include <grpc++/server_builder.h> #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/histogram.h> #include <grpc/support/host_port.h> #include <grpc/support/log.h> #include <grpc/support/time.h> -#include <grpc++/client_context.h> -#include <grpc++/server.h> -#include <grpc++/server_builder.h> #include <gtest/gtest.h> -#include "test/cpp/util/create_test_channel.h" +#include "src/core/profiling/timers.h" +#include "src/proto/grpc/testing/services.grpc.pb.h" #include "test/cpp/qps/client.h" #include "test/cpp/qps/histogram.h" #include "test/cpp/qps/interarrival.h" #include "test/cpp/qps/timer.h" -#include "src/proto/grpc/testing/services.grpc.pb.h" - -#include "src/core/profiling/timers.h" namespace grpc { namespace testing { -class SynchronousClient : public Client { +static std::unique_ptr<BenchmarkService::Stub> BenchmarkStubCreator( + std::shared_ptr<Channel> ch) { + return BenchmarkService::NewStub(ch); +} + +class SynchronousClient + : public ClientImpl<BenchmarkService::Stub, SimpleRequest> { public: - SynchronousClient(const ClientConfig& config) : Client(config) { + SynchronousClient(const ClientConfig& config) + : ClientImpl<BenchmarkService::Stub, SimpleRequest>( + config, BenchmarkStubCreator) { num_threads_ = config.outstanding_rpcs_per_channel() * config.client_channels(); responses_.resize(num_threads_); |