#include <memory>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include "absl/flags/flag.h"
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/grpcpp.h>
#include "src/proto/grpc/testing/metrics.grpc.pb.h"
#include "src/proto/grpc/testing/metrics.pb.h"
#include "test/cpp/interop/interop_client.h"
#include "test/cpp/interop/stress_interop_client.h"
#include "test/cpp/util/create_test_channel.h"
#include "test/cpp/util/metrics_server.h"
#include "test/cpp/util/test_config.h"
Go to the source code of this file.
Functions | |
ABSL_FLAG (bool, do_not_abort_on_transient_failures, true, "If set to 'true', abort() is not called in case of transient " "failures like temporary connection failures.") | |
ABSL_FLAG (bool, use_alts, false, "Whether to use alts. Enable alts will disable tls.") | |
ABSL_FLAG (bool, use_test_ca, false, "False to use SSL roots for google") | |
ABSL_FLAG (bool, use_tls, false, "Whether to use tls.") | |
ABSL_FLAG (int32_t, log_level, GPR_LOG_SEVERITY_INFO, "Severity level of messages that should be logged. Any messages " "greater than or equal to the level set here will be logged. " "The choices are: 0 (GPR_LOG_SEVERITY_DEBUG), 1 " "(GPR_LOG_SEVERITY_INFO) and 2 (GPR_LOG_SEVERITY_ERROR)") | |
ABSL_FLAG (int32_t, metrics_port, 8081, "The metrics server port.") | |
ABSL_FLAG (int32_t, num_channels_per_server, 1, "Number of channels for each server") | |
ABSL_FLAG (int32_t, num_stubs_per_channel, 1, "Number of stubs per each channels to server. This number also " "indicates the max number of parallel RPC calls on each channel " "at any given time.") | |
ABSL_FLAG (int32_t, sleep_duration_ms, 0, "The duration (in millisec) between two" " consecutive test calls (per server) issued by the server.") | |
ABSL_FLAG (int32_t, test_duration_secs, -1, "The length of time (in seconds) to run" " the test. Enter -1 if the test should run continuously until" " forcefully terminated.") | |
ABSL_FLAG (std::string, server_addresses, "localhost:8080", "The list of server addresses. The format is: \n" " \"<name_1>:<port_1>,<name_2>:<port_1>...<name_N>:<port_N>\"\n" " Note: <name> can be servername or IP address.") | |
ABSL_FLAG (std::string, server_host_override, "", "Override the server host which is sent in HTTP header") | |
ABSL_FLAG (std::string, test_cases, "", "List of test cases to call along with the" " relative weights in the following format:\n" " \"<testcase_1:w_1>,<testcase_2:w_2>...<testcase_n:w_n>\"\n" " The following testcases are currently supported:\n" " empty_unary\n" " large_unary\n" " large_compressed_unary\n" " client_streaming\n" " server_streaming\n" " server_compressed_streaming\n" " slow_consumer\n" " half_duplex\n" " ping_pong\n" " cancel_after_begin\n" " cancel_after_first_response\n" " timeout_on_sleeping_server\n" " empty_stream\n" " status_code_and_message\n" " custom_metadata\n" " Example: \"empty_unary:20,large_unary:10,empty_stream:70\"\n" " The above will execute 'empty_unary', 20% of the time," " 'large_unary', 10% of the time and 'empty_stream' the remaining" " 70% of the time") | |
TestCaseType | GetTestTypeFromName (const std::string &test_name) |
void | gpr_default_log (gpr_log_func_args *args) |
void | LogParameterInfo (const std::vector< std::string > &addresses, const std::vector< std::pair< TestCaseType, int >> &tests) |
int | main (int argc, char **argv) |
bool | ParseCommaDelimitedString (const std::string &comma_delimited_str, std::vector< std::string > &tokens) |
bool | ParseTestCasesString (const std::string &test_cases, std::vector< std::pair< TestCaseType, int >> &tests) |
void | TestLogFunction (gpr_log_func_args *args) |
Variables | |
static int | log_level = GPR_LOG_SEVERITY_DEBUG |
ABSL_FLAG | ( | bool | , |
do_not_abort_on_transient_failures | , | ||
true | , | ||
"If set to 'true' | , | ||
abort() is not called in case of transient " "failures like temporary connection failures." | |||
) |
ABSL_FLAG | ( | int32_t | , |
log_level | , | ||
GPR_LOG_SEVERITY_INFO | , | ||
"Severity level of messages that should be logged. Any messages " "greater than or equal to the level set here will be logged. " "The choices are: 0 | GPR_LOG_SEVERITY_DEBUG, | ||
1 " "(GPR_LOG_SEVERITY_INFO) and 2(GPR_LOG_SEVERITY_ERROR)" | |||
) |
ABSL_FLAG | ( | int32_t | , |
num_stubs_per_channel | , | ||
1 | , | ||
"Number of stubs per each channels to server. This number also " "indicates the max number of parallel RPC calls on each channel " "at any given time." | |||
) |
ABSL_FLAG | ( | int32_t | , |
sleep_duration_ms | , | ||
0 | , | ||
"The duration (in millisec) between two" " consecutive test calls (per server) issued by the server." | |||
) |
ABSL_FLAG | ( | int32_t | , |
test_duration_secs | , | ||
- | 1, | ||
"The length of time (in seconds) to run" " the test. Enter -1 if the test should run continuously until" " forcefully terminated." | |||
) |
ABSL_FLAG | ( | std::string | , |
server_addresses | , | ||
"localhost:8080" | , | ||
"The list of server addresses. The format is: \n" " \"<name_1>:<port_1> | , | ||
< name_2 >:< port_1 >...< name_N >:< port_N >\"\n" " Note: <name> can be servername or IP address." | |||
) |
ABSL_FLAG | ( | std::string | , |
server_host_override | , | ||
"" | , | ||
"Override the server host which is sent in HTTP header" | |||
) |
ABSL_FLAG | ( | std::string | , |
test_cases | , | ||
"" | , | ||
"List of test cases to call along with the" " relative weights in the following format:\n" " \"<testcase_1:w_1> | , | ||
< testcase_2:w_2 >...< testcase_n:w_n >\"\n" " The following testcases are currently supported:\n" " empty_unary\n" " large_unary\n" " large_compressed_unary\n" " client_streaming\n" " server_streaming\n" " server_compressed_streaming\n" " slow_consumer\n" " half_duplex\n" " ping_pong\n" " cancel_after_begin\n" " cancel_after_first_response\n" " timeout_on_sleeping_server\n" " empty_stream\n" " status_code_and_message\n" " custom_metadata\n" " Example: \"empty_unary:20 | , | ||
large_unary:10 | , | ||
empty_stream:70\"\n" " The above will execute 'empty_unary' | , | ||
20% of the | time, | ||
" " 'large_unary' | , | ||
10% of the time and 'empty_stream' the remaining" " 70% of the time" | |||
) |
TestCaseType GetTestTypeFromName | ( | const std::string & | test_name | ) |
Definition at line 134 of file stress_test.cc.
void gpr_default_log | ( | gpr_log_func_args * | args | ) |
void LogParameterInfo | ( | const std::vector< std::string > & | addresses, |
const std::vector< std::pair< TestCaseType, int >> & | tests | ||
) |
Definition at line 198 of file stress_test.cc.
Definition at line 230 of file stress_test.cc.
bool ParseCommaDelimitedString | ( | const std::string & | comma_delimited_str, |
std::vector< std::string > & | tokens | ||
) |
Definition at line 148 of file stress_test.cc.
bool ParseTestCasesString | ( | const std::string & | test_cases, |
std::vector< std::pair< TestCaseType, int >> & | tests | ||
) |
Definition at line 166 of file stress_test.cc.
void TestLogFunction | ( | gpr_log_func_args * | args | ) |
Definition at line 128 of file stress_test.cc.
|
static |
Definition at line 124 of file stress_test.cc.