blob: fc35db5233ab0b07296df15f3433e372bad5e5d2 [file] [log] [blame]
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -07001/*
2 *
Craig Tiller6169d5f2016-03-31 07:46:18 -07003 * Copyright 2015, Google Inc.
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -07004 * 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 *is % allowed in string
32 */
33
34#include <memory>
35#include <string>
36#include <thread>
37#include <utility>
38#include <vector>
39
40#include <gflags/gflags.h>
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -070041#include <grpc++/create_channel.h>
42#include <grpc++/grpc++.h>
David Garcia Quintasc79b0652016-07-27 21:11:58 -070043#include <grpc/support/log.h>
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -080044#include <grpc/support/time.h>
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -070045
Craig Tillerf40df232016-03-25 13:38:14 -070046#include "src/proto/grpc/testing/metrics.grpc.pb.h"
47#include "src/proto/grpc/testing/metrics.pb.h"
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -070048#include "test/cpp/interop/client_helper.h"
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -070049#include "test/cpp/interop/interop_client.h"
50#include "test/cpp/interop/stress_interop_client.h"
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -070051#include "test/cpp/util/metrics_server.h"
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -070052#include "test/cpp/util/test_config.h"
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -070053
Sree Kuchibhotla0fa95ea2016-01-06 07:58:10 -080054extern "C" {
55extern void gpr_default_log(gpr_log_func_args* args);
56}
57
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -070058DEFINE_int32(metrics_port, 8081, "The metrics server port.");
59
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -070060DEFINE_int32(sleep_duration_ms, 0,
61 "The duration (in millisec) between two"
62 " consecutive test calls (per server) issued by the server.");
63
64DEFINE_int32(test_duration_secs, -1,
65 "The length of time (in seconds) to run"
66 " the test. Enter -1 if the test should run continuously until"
67 " forcefully terminated.");
68
69DEFINE_string(server_addresses, "localhost:8080",
70 "The list of server"
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -070071 "addresses. This option is ignored if either\n"
72 "server_port or server_host is specified. The format is: \n"
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -070073 " \"<name_1>:<port_1>,<name_2>:<port_1>...<name_N>:<port_N>\"\n"
74 " Note: <name> can be servername or IP address.");
75
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -080076DEFINE_int32(num_channels_per_server, 1, "Number of channels for each server");
77
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -070078DEFINE_int32(num_stubs_per_channel, 1,
79 "Number of stubs per each channels to server. This number also "
80 "indicates the max number of parallel RPC calls on each channel "
81 "at any given time.");
82
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -070083DEFINE_string(test_case, "",
84 "Configure different test cases. Valid options are:\n\n"
85 "all : all test cases;\n"
86 "cancel_after_begin : cancel stream after starting it;\n"
87 "cancel_after_first_response: cancel on first response;\n"
88 "client_compressed_streaming : compressed request streaming with "
89 "client_compressed_unary : single compressed request;\n"
90 "client_streaming : request streaming with single response;\n"
91 "compute_engine_creds: large_unary with compute engine auth;\n"
92 "custom_metadata: server will echo custom metadata;\n"
93 "empty_stream : bi-di stream with no request/response;\n"
94 "empty_unary : empty (zero bytes) request and response;\n"
95 "half_duplex : half-duplex streaming;\n"
96 "jwt_token_creds: large_unary with JWT token auth;\n"
97 "large_unary : single request and (large) response;\n"
98 "oauth2_auth_token: raw oauth2 access token auth;\n"
99 "per_rpc_creds: raw oauth2 access token on a single rpc;\n"
100 "ping_pong : full-duplex streaming;\n"
101 "response streaming;\n"
102 "server_compressed_streaming : single request with compressed "
103 "server_compressed_unary : single compressed response;\n"
104 "server_streaming : single request with response streaming;\n"
105 "slow_consumer : single request with response streaming with "
106 "slow client consumer;\n"
107 "status_code_and_message: verify status code & message;\n"
108 "timeout_on_sleeping_server: deadline exceeds on stream;\n"
109 "unimplemented_method: client calls an unimplemented_method;\n");
110
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700111// TODO(sreek): Add more test cases here in future
112DEFINE_string(test_cases, "",
113 "List of test cases to call along with the"
114 " relative weights in the following format:\n"
115 " \"<testcase_1:w_1>,<testcase_2:w_2>...<testcase_n:w_n>\"\n"
116 " The following testcases are currently supported:\n"
117 " empty_unary\n"
118 " large_unary\n"
119 " large_compressed_unary\n"
120 " client_streaming\n"
121 " server_streaming\n"
Sree Kuchibhotla51304272016-05-05 15:19:00 -0700122 " server_compressed_streaming\n"
123 " slow_consumer\n"
124 " half_duplex\n"
125 " ping_pong\n"
126 " cancel_after_begin\n"
127 " cancel_after_first_response\n"
128 " timeout_on_sleeping_server\n"
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700129 " empty_stream\n"
Sree Kuchibhotla51304272016-05-05 15:19:00 -0700130 " status_code_and_message\n"
131 " custom_metadata\n"
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700132 " Example: \"empty_unary:20,large_unary:10,empty_stream:70\"\n"
133 " The above will execute 'empty_unary', 20% of the time,"
134 " 'large_unary', 10% of the time and 'empty_stream' the remaining"
135 " 70% of the time");
136
Sree Kuchibhotla16dd3e42016-03-31 09:46:20 -0700137DEFINE_int32(log_level, GPR_LOG_SEVERITY_INFO,
Sree Kuchibhotla0fa95ea2016-01-06 07:58:10 -0800138 "Severity level of messages that should be logged. Any messages "
139 "greater than or equal to the level set here will be logged. "
140 "The choices are: 0 (GPR_LOG_SEVERITY_DEBUG), 1 "
Sree Kuchibhotla16dd3e42016-03-31 09:46:20 -0700141 "(GPR_LOG_SEVERITY_INFO) and 2 (GPR_LOG_SEVERITY_ERROR)");
Sree Kuchibhotla0fa95ea2016-01-06 07:58:10 -0800142
Sree Kuchibhotlaad0f7922016-05-04 19:49:31 -0700143DEFINE_bool(do_not_abort_on_transient_failures, true,
144 "If set to 'true', abort() is not called in case of transient "
145 "failures like temporary connection failures.");
146
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -0700147// Options from client.cc (for compatibility with interop test).
148// TODO(sreek): Consolidate overlapping options
149DEFINE_bool(use_tls, false, "Whether to use tls.");
150DEFINE_bool(use_test_ca, false, "False to use SSL roots for google");
151DEFINE_int32(server_port, 0, "Server port.");
152DEFINE_string(server_host, "127.0.0.1", "Server host to connect to");
153DEFINE_string(server_host_override, "foo.test.google.fr",
154 "Override the server host which is sent in HTTP header");
155DEFINE_string(service_account_key_file, "",
156 "Path to service account json key file.");
157
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700158using grpc::testing::kTestCaseList;
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700159using grpc::testing::MetricsService;
160using grpc::testing::MetricsServiceImpl;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700161using grpc::testing::StressTestInteropClient;
162using grpc::testing::TestCaseType;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700163using grpc::testing::UNKNOWN_TEST;
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700164using grpc::testing::WeightedRandomTestSelector;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700165
Sree Kuchibhotla0fa95ea2016-01-06 07:58:10 -0800166static int log_level = GPR_LOG_SEVERITY_DEBUG;
167
168// A simple wrapper to grp_default_log() function. This only logs messages at or
169// above the current log level (set in 'log_level' variable)
170void TestLogFunction(gpr_log_func_args* args) {
171 if (args->severity >= log_level) {
172 gpr_default_log(args);
173 }
174}
175
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700176TestCaseType GetTestTypeFromName(const grpc::string& test_name) {
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700177 TestCaseType test_case = UNKNOWN_TEST;
178
179 for (auto it = kTestCaseList.begin(); it != kTestCaseList.end(); it++) {
180 if (test_name == it->second) {
181 test_case = it->first;
182 break;
183 }
184 }
185
186 return test_case;
187}
188
189// Converts a string of comma delimited tokens to a vector of tokens
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700190bool ParseCommaDelimitedString(const grpc::string& comma_delimited_str,
Sree Kuchibhotlab047c0f2015-11-16 11:52:54 -0800191 std::vector<grpc::string>& tokens) {
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700192 size_t bpos = 0;
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700193 size_t epos = grpc::string::npos;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700194
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700195 while ((epos = comma_delimited_str.find(',', bpos)) != grpc::string::npos) {
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700196 tokens.emplace_back(comma_delimited_str.substr(bpos, epos - bpos));
197 bpos = epos + 1;
198 }
199
200 tokens.emplace_back(comma_delimited_str.substr(bpos)); // Last token
201 return true;
202}
203
204// Input: Test case string "<testcase_name:weight>,<testcase_name:weight>...."
205// Output:
206// - Whether parsing was successful (return value)
207// - Vector of (test_type_enum, weight) pairs returned via 'tests' parameter
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700208bool ParseTestCasesString(const grpc::string& test_cases,
Sree Kuchibhotlab047c0f2015-11-16 11:52:54 -0800209 std::vector<std::pair<TestCaseType, int>>& tests) {
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700210 bool is_success = true;
211
Sree Kuchibhotlab047c0f2015-11-16 11:52:54 -0800212 std::vector<grpc::string> tokens;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700213 ParseCommaDelimitedString(test_cases, tokens);
214
215 for (auto it = tokens.begin(); it != tokens.end(); it++) {
216 // Token is in the form <test_name>:<test_weight>
217 size_t colon_pos = it->find(':');
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700218 if (colon_pos == grpc::string::npos) {
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700219 gpr_log(GPR_ERROR, "Error in parsing test case string: %s", it->c_str());
220 is_success = false;
221 break;
222 }
223
Sree Kuchibhotlaf51ea7a2015-10-26 13:34:41 -0700224 grpc::string test_name = it->substr(0, colon_pos);
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700225 int weight = std::stoi(it->substr(colon_pos + 1));
226 TestCaseType test_case = GetTestTypeFromName(test_name);
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700227 if (test_case == UNKNOWN_TEST) {
228 gpr_log(GPR_ERROR, "Unknown test case: %s", test_name.c_str());
229 is_success = false;
230 break;
231 }
232
233 tests.emplace_back(std::make_pair(test_case, weight));
234 }
235
236 return is_success;
237}
238
239// For debugging purposes
Sree Kuchibhotlab047c0f2015-11-16 11:52:54 -0800240void LogParameterInfo(const std::vector<grpc::string>& addresses,
241 const std::vector<std::pair<TestCaseType, int>>& tests) {
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700242 gpr_log(GPR_INFO, "server_addresses: %s", FLAGS_server_addresses.c_str());
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -0700243 gpr_log(GPR_INFO, "server_host: %s", FLAGS_server_host.c_str());
244 gpr_log(GPR_INFO, "server_port: %d", FLAGS_server_port);
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700245 gpr_log(GPR_INFO, "test_cases : %s", FLAGS_test_cases.c_str());
246 gpr_log(GPR_INFO, "sleep_duration_ms: %d", FLAGS_sleep_duration_ms);
247 gpr_log(GPR_INFO, "test_duration_secs: %d", FLAGS_test_duration_secs);
Sree Kuchibhotlaad0f7922016-05-04 19:49:31 -0700248 gpr_log(GPR_INFO, "num_channels_per_server: %d",
249 FLAGS_num_channels_per_server);
250 gpr_log(GPR_INFO, "num_stubs_per_channel: %d", FLAGS_num_stubs_per_channel);
251 gpr_log(GPR_INFO, "log_level: %d", FLAGS_log_level);
252 gpr_log(GPR_INFO, "do_not_abort_on_transient_failures: %s",
253 FLAGS_do_not_abort_on_transient_failures ? "true" : "false");
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700254
255 int num = 0;
256 for (auto it = addresses.begin(); it != addresses.end(); it++) {
257 gpr_log(GPR_INFO, "%d:%s", ++num, it->c_str());
258 }
259
260 num = 0;
261 for (auto it = tests.begin(); it != tests.end(); it++) {
262 TestCaseType test_case = it->first;
263 int weight = it->second;
264 gpr_log(GPR_INFO, "%d. TestCaseType: %d, Weight: %d", ++num, test_case,
265 weight);
266 }
267}
268
269int main(int argc, char** argv) {
270 grpc::testing::InitTest(&argc, &argv, true);
271
Sree Kuchibhotla0fa95ea2016-01-06 07:58:10 -0800272 if (FLAGS_log_level > GPR_LOG_SEVERITY_ERROR ||
273 FLAGS_log_level < GPR_LOG_SEVERITY_DEBUG) {
274 gpr_log(GPR_ERROR, "log_level should be an integer between %d and %d",
275 GPR_LOG_SEVERITY_DEBUG, GPR_LOG_SEVERITY_ERROR);
276 return 1;
277 }
278
279 // Change the default log function to TestLogFunction which respects the
280 // log_level setting.
281 log_level = FLAGS_log_level;
282 gpr_set_log_function(TestLogFunction);
283
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700284 srand(time(NULL));
285
286 // Parse the server addresses
Sree Kuchibhotlab047c0f2015-11-16 11:52:54 -0800287 std::vector<grpc::string> server_addresses;
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -0700288 if (FLAGS_server_port != 0) {
289 // We are using interop_client style cmdline options.
290 const int host_port_buf_size = 1024;
291 char host_port[host_port_buf_size];
292 snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(),
293 FLAGS_server_port);
294 std::string host_port_str(host_port);
295 ParseCommaDelimitedString(host_port_str, server_addresses);
296 } else {
297 ParseCommaDelimitedString(FLAGS_server_addresses, server_addresses);
298 }
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700299
300 // Parse test cases and weights
301 if (FLAGS_test_cases.length() == 0) {
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -0700302 // We are using interop_client style test_case option
303 FLAGS_test_cases = FLAGS_test_case + ":100";
304 } else if (FLAGS_test_case != "") {
305 gpr_log(GPR_ERROR, "specify --test_case or --test_cases but not both.");
Sree Kuchibhotla117c8af2015-10-26 10:59:17 -0700306 return 1;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700307 }
308
Sree Kuchibhotlab047c0f2015-11-16 11:52:54 -0800309 std::vector<std::pair<TestCaseType, int>> tests;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700310 if (!ParseTestCasesString(FLAGS_test_cases, tests)) {
311 gpr_log(GPR_ERROR, "Error in parsing test cases string %s ",
312 FLAGS_test_cases.c_str());
313 return 1;
314 }
315
316 LogParameterInfo(server_addresses, tests);
317
318 WeightedRandomTestSelector test_selector(tests);
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700319 MetricsServiceImpl metrics_service;
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700320
321 gpr_log(GPR_INFO, "Starting test(s)..");
Sree Kuchibhotla728a6102015-10-16 10:56:31 -0700322
Vijay Pai320ed132016-11-01 17:16:55 -0700323 std::vector<std::thread> test_threads;
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700324
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800325 // Create and start the test threads.
326 // Note that:
327 // - Each server can have multiple channels (as configured by
328 // FLAGS_num_channels_per_server).
329 //
330 // - Each channel can have multiple stubs (as configured by
331 // FLAGS_num_stubs_per_channel). This is to test calling multiple RPCs in
332 // parallel on the same channel.
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700333 int thread_idx = 0;
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800334 int server_idx = -1;
335 char buffer[256];
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700336 for (auto it = server_addresses.begin(); it != server_addresses.end(); it++) {
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800337 ++server_idx;
338 // Create channel(s) for each server
339 for (int channel_idx = 0; channel_idx < FLAGS_num_channels_per_server;
340 channel_idx++) {
Makarand Dharmapurikarf01f7b62016-10-21 09:07:06 -0700341 gpr_log(GPR_INFO, "Starting test with %s channel_idx=%d..", it->c_str(),
342 channel_idx);
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -0700343 std::shared_ptr<grpc::Channel> channel;
344 if (FLAGS_use_tls) {
345 channel = grpc::testing::CreateChannelForTestCase(FLAGS_test_case);
346 } else {
347 channel = grpc::CreateChannel(*it, grpc::InsecureChannelCredentials());
348 }
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700349
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800350 // Create stub(s) for each channel
351 for (int stub_idx = 0; stub_idx < FLAGS_num_stubs_per_channel;
352 stub_idx++) {
353 StressTestInteropClient* client = new StressTestInteropClient(
354 ++thread_idx, *it, channel, test_selector, FLAGS_test_duration_secs,
Sree Kuchibhotlaad0f7922016-05-04 19:49:31 -0700355 FLAGS_sleep_duration_ms, FLAGS_do_not_abort_on_transient_failures);
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700356
Sree Kuchibhotla3714e302016-04-22 09:50:46 -0700357 bool is_already_created = false;
358 // QpsGauge name
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800359 std::snprintf(buffer, sizeof(buffer),
360 "/stress_test/server_%d/channel_%d/stub_%d/qps",
361 server_idx, channel_idx, stub_idx);
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700362
Vijay Pai320ed132016-11-01 17:16:55 -0700363 test_threads.emplace_back(std::thread(
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800364 &StressTestInteropClient::MainLoop, client,
Sree Kuchibhotla3714e302016-04-22 09:50:46 -0700365 metrics_service.CreateQpsGauge(buffer, &is_already_created)));
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800366
Sree Kuchibhotla3714e302016-04-22 09:50:46 -0700367 // The QpsGauge should not have been already created
Sree Kuchibhotlae1330ff2015-11-20 09:53:44 -0800368 GPR_ASSERT(!is_already_created);
369 }
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700370 }
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700371 }
372
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700373 // Start metrics server before waiting for the stress test threads
Makarand Dharmapurikare3dd1d72016-10-20 10:37:39 -0700374 if (FLAGS_metrics_port > 0) {
375 std::unique_ptr<grpc::Server> metrics_server =
376 metrics_service.StartServer(FLAGS_metrics_port);
377 }
378
Sree Kuchibhotlab5e98c52015-10-27 22:55:26 -0700379 // Wait for the stress test threads to complete
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700380 for (auto it = test_threads.begin(); it != test_threads.end(); it++) {
381 it->join();
382 }
383
Sree Kuchibhotlafbc376f2015-10-16 10:56:31 -0700384 return 0;
385}