Test making successful RPC calls.
| 181 | |
| 182 | // Test making successful RPC calls. |
| 183 | TEST_F(RpcBench, BenchmarkCalls) { |
| 184 | Stopwatch sw(Stopwatch::ALL_THREADS); |
| 185 | sw.start(); |
| 186 | |
| 187 | vector<unique_ptr<ClientThread>> threads; |
| 188 | for (int i = 0; i < FLAGS_client_threads; i++) { |
| 189 | threads.emplace_back(new ClientThread(this)); |
| 190 | threads.back()->Start(); |
| 191 | } |
| 192 | |
| 193 | SleepFor(MonoDelta::FromSeconds(FLAGS_run_seconds)); |
| 194 | Release_Store(&should_run_, false); |
| 195 | |
| 196 | int total_reqs = 0; |
| 197 | |
| 198 | for (auto& thr : threads) { |
| 199 | thr->Join(); |
| 200 | total_reqs += thr->request_count_; |
| 201 | } |
| 202 | sw.stop(); |
| 203 | |
| 204 | SummarizePerf(sw.elapsed(), total_reqs, true); |
| 205 | } |
| 206 | |
| 207 | class ClientAsyncWorkload { |
| 208 | public: |