Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright 2015, Google Inc. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions are |
| 8 | * met: |
| 9 | * |
| 10 | * * Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * * Redistributions in binary form must reproduce the above |
| 13 | * copyright notice, this list of conditions and the following disclaimer |
| 14 | * in the documentation and/or other materials provided with the |
| 15 | * distribution. |
| 16 | * * Neither the name of Google Inc. nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | #ifndef TEST_QPS_CLIENT_H |
| 35 | #define TEST_QPS_CLIENT_H |
| 36 | |
yang-g | 9e2f90c | 2015-08-21 15:35:03 -0700 | [diff] [blame] | 37 | #include <condition_variable> |
| 38 | #include <mutex> |
| 39 | |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 40 | #include "test/cpp/qps/histogram.h" |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 41 | #include "test/cpp/qps/interarrival.h" |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 42 | #include "test/cpp/qps/timer.h" |
yang-g | 9e2f90c | 2015-08-21 15:35:03 -0700 | [diff] [blame] | 43 | #include "test/cpp/util/create_test_channel.h" |
vjpai | 780a7f2 | 2015-11-04 00:19:09 -0800 | [diff] [blame] | 44 | #include "test/proto/benchmarks/payloads.grpc.pb.h" |
vjpai | d08a738 | 2015-11-02 16:45:08 -0800 | [diff] [blame] | 45 | #include "test/proto/benchmarks/services.grpc.pb.h" |
Craig Tiller | e38ec21 | 2015-03-04 11:19:15 -0800 | [diff] [blame] | 46 | |
Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 47 | namespace grpc { |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 48 | |
| 49 | #if defined(__APPLE__) |
| 50 | // Specialize Timepoint for high res clock as we need that |
| 51 | template <> |
| 52 | class TimePoint<std::chrono::high_resolution_clock::time_point> { |
| 53 | public: |
| 54 | TimePoint(const std::chrono::high_resolution_clock::time_point& time) { |
| 55 | TimepointHR2Timespec(time, &time_); |
| 56 | } |
| 57 | gpr_timespec raw_time() const { return time_; } |
| 58 | |
| 59 | private: |
| 60 | gpr_timespec time_; |
| 61 | }; |
| 62 | #endif |
| 63 | |
Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 64 | namespace testing { |
| 65 | |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 66 | typedef std::chrono::high_resolution_clock grpc_time_source; |
| 67 | typedef std::chrono::time_point<grpc_time_source> grpc_time; |
| 68 | |
Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 69 | class Client { |
| 70 | public: |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 71 | explicit Client(const ClientConfig& config) |
Vijay Pai | 90e7369 | 2015-08-05 19:15:36 -0700 | [diff] [blame] | 72 | : channels_(config.client_channels()), |
| 73 | timer_(new Timer), |
| 74 | interarrival_timer_() { |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 75 | for (int i = 0; i < config.client_channels(); i++) { |
Vijay Pai | eed63fa | 2015-08-05 23:08:34 +0000 | [diff] [blame] | 76 | channels_[i].init(config.server_targets(i % config.server_targets_size()), |
Vijay Pai | 90e7369 | 2015-08-05 19:15:36 -0700 | [diff] [blame] | 77 | config); |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 78 | } |
vjpai | 780a7f2 | 2015-11-04 00:19:09 -0800 | [diff] [blame] | 79 | if (config.payload_config().has_bytebuf_params()) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 80 | GPR_ASSERT(false); // not yet implemented |
vjpai | 780a7f2 | 2015-11-04 00:19:09 -0800 | [diff] [blame] | 81 | } else if (config.payload_config().has_simple_params()) { |
| 82 | request_.set_response_type(grpc::testing::PayloadType::COMPRESSABLE); |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 83 | request_.set_response_size( |
| 84 | config.payload_config().simple_params().resp_size()); |
| 85 | request_.mutable_payload()->set_type( |
| 86 | grpc::testing::PayloadType::COMPRESSABLE); |
vjpai | 780a7f2 | 2015-11-04 00:19:09 -0800 | [diff] [blame] | 87 | int size = config.payload_config().simple_params().req_size(); |
| 88 | std::unique_ptr<char[]> body(new char[size]); |
| 89 | request_.mutable_payload()->set_body(body.get(), size); |
| 90 | } else if (config.payload_config().has_complex_params()) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 91 | GPR_ASSERT(false); // not yet implemented |
vjpai | 780a7f2 | 2015-11-04 00:19:09 -0800 | [diff] [blame] | 92 | } else { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 93 | GPR_ASSERT(false); // badly configured |
vjpai | 780a7f2 | 2015-11-04 00:19:09 -0800 | [diff] [blame] | 94 | } |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 95 | } |
Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 96 | virtual ~Client() {} |
Craig Tiller | 6af9ed0 | 2015-03-02 22:42:10 -0800 | [diff] [blame] | 97 | |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 98 | ClientStats Mark(bool reset) { |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 99 | Histogram latencies; |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 100 | Timer::Result timer_result; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 101 | |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 102 | // avoid std::vector for old compilers that expect a copy constructor |
| 103 | if (reset) { |
| 104 | Histogram* to_merge = new Histogram[threads_.size()]; |
| 105 | for (size_t i = 0; i < threads_.size(); i++) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 106 | threads_[i]->BeginSwap(&to_merge[i]); |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 107 | } |
| 108 | std::unique_ptr<Timer> timer(new Timer); |
| 109 | timer_.swap(timer); |
| 110 | for (size_t i = 0; i < threads_.size(); i++) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 111 | threads_[i]->EndSwap(); |
| 112 | latencies.Merge(to_merge[i]); |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 113 | } |
| 114 | delete[] to_merge; |
| 115 | timer_result = timer->Mark(); |
| 116 | } else { |
| 117 | // merge snapshots of each thread histogram |
| 118 | for (size_t i = 0; i < threads_.size(); i++) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 119 | threads_[i]->MergeStatsInto(&latencies); |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 120 | } |
| 121 | timer_result = timer_->Mark(); |
| 122 | } |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 123 | |
| 124 | ClientStats stats; |
| 125 | latencies.FillProto(stats.mutable_latencies()); |
| 126 | stats.set_time_elapsed(timer_result.wall); |
| 127 | stats.set_time_system(timer_result.system); |
| 128 | stats.set_time_user(timer_result.user); |
| 129 | return stats; |
| 130 | } |
| 131 | |
| 132 | protected: |
| 133 | SimpleRequest request_; |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 134 | bool closed_loop_; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 135 | |
| 136 | class ClientChannelInfo { |
| 137 | public: |
Vijay Pai | eed63fa | 2015-08-05 23:08:34 +0000 | [diff] [blame] | 138 | ClientChannelInfo() {} |
vjpai | b1db869 | 2015-08-11 22:41:02 -0700 | [diff] [blame] | 139 | ClientChannelInfo(const ClientChannelInfo& i) { |
Vijay Pai | 90e7369 | 2015-08-05 19:15:36 -0700 | [diff] [blame] | 140 | // The copy constructor is to satisfy old compilers |
| 141 | // that need it for using std::vector . It is only ever |
| 142 | // used for empty entries |
Vijay Pai | eed63fa | 2015-08-05 23:08:34 +0000 | [diff] [blame] | 143 | GPR_ASSERT(!i.channel_ && !i.stub_); |
| 144 | } |
| 145 | void init(const grpc::string& target, const ClientConfig& config) { |
Vijay Pai | 90e7369 | 2015-08-05 19:15:36 -0700 | [diff] [blame] | 146 | // We have to use a 2-phase init like this with a default |
| 147 | // constructor followed by an initializer function to make |
| 148 | // old compilers happy with using this in std::vector |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 149 | channel_ = CreateTestChannel( |
| 150 | target, config.security_params().server_host_override(), |
| 151 | config.has_security_params(), |
| 152 | !config.security_params().use_test_ca()); |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 153 | stub_ = BenchmarkService::NewStub(channel_); |
Vijay Pai | eed63fa | 2015-08-05 23:08:34 +0000 | [diff] [blame] | 154 | } |
yang-g | 8c2be9f | 2015-08-19 16:28:09 -0700 | [diff] [blame] | 155 | Channel* get_channel() { return channel_.get(); } |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 156 | BenchmarkService::Stub* get_stub() { return stub_.get(); } |
Vijay Pai | 90e7369 | 2015-08-05 19:15:36 -0700 | [diff] [blame] | 157 | |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 158 | private: |
yang-g | 8c2be9f | 2015-08-19 16:28:09 -0700 | [diff] [blame] | 159 | std::shared_ptr<Channel> channel_; |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 160 | std::unique_ptr<BenchmarkService::Stub> stub_; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 161 | }; |
| 162 | std::vector<ClientChannelInfo> channels_; |
| 163 | |
| 164 | void StartThreads(size_t num_threads) { |
Craig Tiller | a182bf1 | 2015-03-04 13:54:39 -0800 | [diff] [blame] | 165 | for (size_t i = 0; i < num_threads; i++) { |
| 166 | threads_.emplace_back(new Thread(this, i)); |
| 167 | } |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 168 | } |
| 169 | |
Craig Tiller | a182bf1 | 2015-03-04 13:54:39 -0800 | [diff] [blame] | 170 | void EndThreads() { threads_.clear(); } |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 171 | |
Craig Tiller | 8a5a666 | 2015-04-09 11:31:28 -0700 | [diff] [blame] | 172 | virtual bool ThreadFunc(Histogram* histogram, size_t thread_idx) = 0; |
Vijay Pai | 8559485 | 2015-06-03 11:01:25 -0700 | [diff] [blame] | 173 | |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 174 | void SetupLoadTest(const ClientConfig& config, size_t num_threads) { |
| 175 | // Set up the load distribution based on the number of threads |
vjpai | 754751e | 2015-10-28 09:16:22 -0700 | [diff] [blame] | 176 | const auto& load = config.load_params(); |
| 177 | |
| 178 | std::unique_ptr<RandomDist> random_dist; |
| 179 | if (load.has_poisson()) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 180 | random_dist.reset( |
| 181 | new ExpDist(load.poisson().offered_load() / num_threads)); |
vjpai | 754751e | 2015-10-28 09:16:22 -0700 | [diff] [blame] | 182 | } else if (load.has_uniform()) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 183 | random_dist.reset( |
| 184 | new UniformDist(load.uniform().interarrival_lo() * num_threads, |
| 185 | load.uniform().interarrival_hi() * num_threads)); |
vjpai | 754751e | 2015-10-28 09:16:22 -0700 | [diff] [blame] | 186 | } else if (load.has_determ()) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 187 | random_dist.reset( |
| 188 | new DetDist(num_threads / load.determ().offered_load())); |
vjpai | 754751e | 2015-10-28 09:16:22 -0700 | [diff] [blame] | 189 | } else if (load.has_pareto()) { |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 190 | random_dist.reset( |
| 191 | new ParetoDist(load.pareto().interarrival_base() * num_threads, |
| 192 | load.pareto().alpha())); |
vjpai | d08a738 | 2015-11-02 16:45:08 -0800 | [diff] [blame] | 193 | } else if (load.has_closed_loop()) { |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 194 | // Closed-loop doesn't use random dist at all |
Vijay Pai | ce84670 | 2015-11-04 00:30:12 -0800 | [diff] [blame] | 195 | } else { // invalid load type |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 196 | GPR_ASSERT(false); |
vjpai | 754751e | 2015-10-28 09:16:22 -0700 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | // Set closed_loop_ based on whether or not random_dist is set |
| 200 | if (!random_dist) { |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 201 | closed_loop_ = true; |
| 202 | } else { |
| 203 | closed_loop_ = false; |
vjpai | 754751e | 2015-10-28 09:16:22 -0700 | [diff] [blame] | 204 | // set up interarrival timer according to random dist |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 205 | interarrival_timer_.init(*random_dist, num_threads); |
| 206 | for (size_t i = 0; i < num_threads; i++) { |
| 207 | next_time_.push_back( |
| 208 | grpc_time_source::now() + |
| 209 | std::chrono::duration_cast<grpc_time_source::duration>( |
| 210 | interarrival_timer_(i))); |
| 211 | } |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | bool NextIssueTime(int thread_idx, grpc_time* time_delay) { |
| 216 | if (closed_loop_) { |
| 217 | return false; |
| 218 | } else { |
| 219 | *time_delay = next_time_[thread_idx]; |
| 220 | next_time_[thread_idx] += |
| 221 | std::chrono::duration_cast<grpc_time_source::duration>( |
| 222 | interarrival_timer_(thread_idx)); |
| 223 | return true; |
| 224 | } |
| 225 | } |
| 226 | |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 227 | private: |
| 228 | class Thread { |
| 229 | public: |
| 230 | Thread(Client* client, size_t idx) |
Vijay Pai | ab1dba7 | 2015-07-31 09:09:09 -0700 | [diff] [blame] | 231 | : done_(false), |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 232 | new_stats_(nullptr), |
Vijay Pai | ab1dba7 | 2015-07-31 09:09:09 -0700 | [diff] [blame] | 233 | client_(client), |
| 234 | idx_(idx), |
| 235 | impl_(&Thread::ThreadFunc, this) {} |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 236 | |
| 237 | ~Thread() { |
| 238 | { |
| 239 | std::lock_guard<std::mutex> g(mu_); |
| 240 | done_ = true; |
| 241 | } |
| 242 | impl_.join(); |
| 243 | } |
| 244 | |
| 245 | void BeginSwap(Histogram* n) { |
| 246 | std::lock_guard<std::mutex> g(mu_); |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 247 | new_stats_ = n; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | void EndSwap() { |
| 251 | std::unique_lock<std::mutex> g(mu_); |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 252 | while (new_stats_ != nullptr) { |
Vijay Pai | 784005b | 2015-07-31 10:53:42 -0700 | [diff] [blame] | 253 | cv_.wait(g); |
| 254 | }; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 255 | } |
| 256 | |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 257 | void MergeStatsInto(Histogram* hist) { |
| 258 | std::unique_lock<std::mutex> g(mu_); |
| 259 | hist->Merge(histogram_); |
| 260 | } |
| 261 | |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 262 | private: |
| 263 | Thread(const Thread&); |
| 264 | Thread& operator=(const Thread&); |
| 265 | |
vjpai | a9e0830 | 2015-07-31 07:55:06 -0700 | [diff] [blame] | 266 | void ThreadFunc() { |
| 267 | for (;;) { |
Vijay Pai | ab1dba7 | 2015-07-31 09:09:09 -0700 | [diff] [blame] | 268 | // run the loop body |
vjpai | b1db869 | 2015-08-11 22:41:02 -0700 | [diff] [blame] | 269 | const bool thread_still_ok = client_->ThreadFunc(&histogram_, idx_); |
Vijay Pai | ab1dba7 | 2015-07-31 09:09:09 -0700 | [diff] [blame] | 270 | // lock, see if we're done |
| 271 | std::lock_guard<std::mutex> g(mu_); |
| 272 | if (!thread_still_ok) { |
| 273 | gpr_log(GPR_ERROR, "Finishing client thread due to RPC error"); |
| 274 | done_ = true; |
| 275 | } |
| 276 | if (done_) { |
| 277 | return; |
| 278 | } |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 279 | // check if we're resetting stats, swap out the histogram if so |
| 280 | if (new_stats_) { |
| 281 | new_stats_->Swap(&histogram_); |
| 282 | new_stats_ = nullptr; |
Vijay Pai | ab1dba7 | 2015-07-31 09:09:09 -0700 | [diff] [blame] | 283 | cv_.notify_one(); |
| 284 | } |
vjpai | a9e0830 | 2015-07-31 07:55:06 -0700 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 288 | BenchmarkService::Stub* stub_; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 289 | ClientConfig config_; |
| 290 | std::mutex mu_; |
| 291 | std::condition_variable cv_; |
| 292 | bool done_; |
vjpai | 119c103 | 2015-10-29 01:21:04 -0700 | [diff] [blame] | 293 | Histogram* new_stats_; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 294 | Histogram histogram_; |
Vijay Pai | ab1dba7 | 2015-07-31 09:09:09 -0700 | [diff] [blame] | 295 | Client* client_; |
vjpai | a9e0830 | 2015-07-31 07:55:06 -0700 | [diff] [blame] | 296 | size_t idx_; |
Craig Tiller | 8856875 | 2015-03-04 10:50:43 -0800 | [diff] [blame] | 297 | std::thread impl_; |
| 298 | }; |
| 299 | |
| 300 | std::vector<std::unique_ptr<Thread>> threads_; |
| 301 | std::unique_ptr<Timer> timer_; |
Vijay Pai | 372fd87 | 2015-06-08 13:30:08 -0700 | [diff] [blame] | 302 | |
| 303 | InterarrivalTimer interarrival_timer_; |
| 304 | std::vector<grpc_time> next_time_; |
Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 305 | }; |
| 306 | |
Craig Tiller | 5c8737d | 2015-05-21 11:42:17 -0700 | [diff] [blame] | 307 | std::unique_ptr<Client> CreateSynchronousUnaryClient(const ClientConfig& args); |
| 308 | std::unique_ptr<Client> CreateSynchronousStreamingClient( |
| 309 | const ClientConfig& args); |
vjpai | 46f6523 | 2015-03-23 10:10:27 -0700 | [diff] [blame] | 310 | std::unique_ptr<Client> CreateAsyncUnaryClient(const ClientConfig& args); |
| 311 | std::unique_ptr<Client> CreateAsyncStreamingClient(const ClientConfig& args); |
Craig Tiller | 26598a3 | 2015-03-02 16:16:00 -0800 | [diff] [blame] | 312 | |
| 313 | } // namespace testing |
| 314 | } // namespace grpc |
| 315 | |
| 316 | #endif |