| 896 | |
| 897 | int mainEntryClickHouseBenchmark(int argc, char ** argv); |
| 898 | int mainEntryClickHouseBenchmark(int argc, char ** argv) |
| 899 | { |
| 900 | using namespace DB; |
| 901 | bool print_stacktrace = false; |
| 902 | |
| 903 | /// Join global-pool threads before the statics they may have accessed are destroyed. |
| 904 | /// That way, accesses happen-before destruction. |
| 905 | SCOPE_EXIT_SAFE({ |
| 906 | DB::StaticThreadPool::shutdownAll(); |
| 907 | GlobalThreadPool::shutdown(); |
| 908 | }); |
| 909 | |
| 910 | try |
| 911 | { |
| 912 | using boost::program_options::value; |
| 913 | |
| 914 | boost::program_options::options_description options_description = createOptionsDescription("Allowed options", getTerminalWidth()); |
| 915 | options_description.add_options() |
| 916 | ("help", "Print usage summary and exit; combine with --verbose to display all options") |
| 917 | ("verbose", "Increase output verbosity") |
| 918 | ("query,q", value<std::string>()->default_value(""), "query to execute") |
| 919 | ("queries-format", value<std::string>()->default_value("tsv"), "format of queries read from standard input: 'tsv' (default, one tab-escaped query per line) or 'script' (parse the input as a script of multiple queries separated by semicolons)") |
| 920 | ("concurrency,c", value<unsigned>()->default_value(1), "number of parallel queries") |
| 921 | ("max_concurrency,C", value<unsigned>()->default_value(0), "gradually increase number of parallel queries up to specified value, making one report for every concurrency level") |
| 922 | ("delay,d", value<double>()->default_value(1), "delay between intermediate reports in seconds (set 0 to disable reports)") |
| 923 | ("precise", "enable precise per-interval reporting with weighted metrics") |
| 924 | ("stage", value<std::string>()->default_value("complete"), "request query processing up to specified stage: complete,fetch_columns,with_mergeable_state,with_mergeable_state_after_aggregation,with_mergeable_state_after_aggregation_and_limit") |
| 925 | ("iterations,i", value<size_t>()->default_value(0), "amount of queries to be executed") |
| 926 | ("timelimit,t", value<double>()->default_value(0.), "stop launch of queries after specified time limit") |
| 927 | ("randomize,r", "randomize order of execution") |
| 928 | ("host,h", value<Strings>()->multitoken(), "list of hosts") |
| 929 | ("port", value<Ports>()->multitoken(), "list of ports") |
| 930 | ("connection", value<std::string>(), "connection name (define under connections_credentials in client config)") |
| 931 | ("roundrobin", "Instead of comparing queries for different --host/--port just pick one random --host/--port for every query and send query to it.") |
| 932 | ("cumulative", "prints cumulative data instead of data per interval") |
| 933 | ("secure,s", "Use TLS connection") |
| 934 | ("accept-invalid-certificate", "Ignore certificate verification errors, equal to config parameters " "openSSL.client.invalidCertificateHandler.name=AcceptCertificateHandler and openSSL.client.verificationMode=none") |
| 935 | ("user,u", value<std::string>(), "") |
| 936 | ("password", value<std::string>(), "") |
| 937 | ("quota_key", value<std::string>(), "") |
| 938 | ("database", value<std::string>(), "") |
| 939 | ("config", value<std::string>(), "Path to client config") |
| 940 | ("stacktrace", "print stack traces of exceptions") |
| 941 | ("confidence", value<size_t>()->default_value(5), "set the level of confidence for T-test [0=80%, 1=90%, 2=95%, 3=98%, 4=99%, 5=99.5%(default)") |
| 942 | ("query_id", value<std::string>()->default_value(""), "") |
| 943 | ("query_id_prefix", value<std::string>()->default_value(""), "") |
| 944 | ("max-consecutive-errors", value<size_t>()->default_value(0), "set number of allowed consecutive errors") |
| 945 | ("ignore-error,continue_on_errors", "continue testing even if a query fails") |
| 946 | ("reconnect", value<size_t>()->default_value(0)->implicit_value(1), "control reconnection behaviour: 0 (never reconnect), 1 (reconnect for every query), or N (reconnect after every N queries); when given without a value, behaves as 1") |
| 947 | ("client-side-time", "display the time including network communication instead of server-side time; note that for server versions before 22.8 we always display client-side time") |
| 948 | ("proto_caps", value<std::string>(), "Enable/disable chunked protocol (comma-separated): chunked_optional, notchunked, notchunked_optional, send_chunked, send_chunked_optional, send_notchunked, send_notchunked_optional, recv_chunked, recv_chunked_optional, recv_notchunked, recv_notchunked_optional") |
| 949 | ; |
| 950 | |
| 951 | Settings settings; |
| 952 | auto options_description_non_verbose = options_description; |
| 953 | settings.addToProgramOptions(options_description); |
| 954 | |
| 955 | auto parser = po::command_line_parser(argc, argv) |
nothing calls this directly
no test coverage detected