Namespaces | Functions
qps_json_driver.cc File Reference
#include <fstream>
#include <iostream>
#include <memory>
#include <set>
#include "absl/flags/flag.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config_protobuf.h>
#include "test/core/util/test_config.h"
#include "test/cpp/qps/benchmark_config.h"
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/parse_json.h"
#include "test/cpp/qps/report.h"
#include "test/cpp/qps/server.h"
#include "test/cpp/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
Include dependency graph for qps_json_driver.cc:

Go to the source code of this file.

Namespaces

 grpc
 
 grpc::testing
 

Functions

 ABSL_FLAG (bool, quit, false, "Quit the workers")
 
 ABSL_FLAG (bool, run_inproc, false, "Perform an in-process transport test")
 
 ABSL_FLAG (double, error_tolerance, 0.01, "Defines threshold for stopping the search. When current search " "range is narrower than the error_tolerance computed range, we " "stop the search.")
 
 ABSL_FLAG (double, initial_search_value, 0.0, "initial parameter value to start the search with (i.e. lower bound)")
 
 ABSL_FLAG (double, stride, 1, "Defines each stride of the search. The larger the stride is, " "the coarser the result will be, but will also be faster.")
 
 ABSL_FLAG (double, targeted_cpu_load, 70.0, "Targeted cpu load (unit: %, range [0,100])")
 
 ABSL_FLAG (int32_t, median_latency_collection_interval_millis, 0, "Specifies the period between gathering latency medians in " "milliseconds. The medians will be logged out on the client at the " "end of the benchmark run. If 0, this periodic collection is disabled.")
 
 ABSL_FLAG (std::string, credential_type, grpc::testing::kInsecureCredentialsType, "Credential type for communication with workers")
 
 ABSL_FLAG (std::string, json_file_out, "", "File to write the JSON output to.")
 
 ABSL_FLAG (std::string, per_worker_credential_types, "", "A map of QPS worker addresses to credential types. When creating a " "channel to a QPS worker's driver port, the qps_json_driver first checks " "if the 'name:port' string is in the map, and it uses the corresponding " "credential type if so. If the QPS worker's 'name:port' string is not " "in the map, then the driver -> worker channel will be created with " "the credentials specified in --credential_type. The value of this flag " "is a semicolon-separated list of map entries, where each map entry is " "a comma-separated pair.")
 
 ABSL_FLAG (std::string, qps_server_target_override, "", "Override QPS server target to configure in client configs." "Only applicable if there is a single benchmark server.")
 
 ABSL_FLAG (std::string, scenarios_file, "", "JSON file containing an array of Scenario objects")
 
 ABSL_FLAG (std::string, scenarios_json, "", "JSON string containing an array of Scenario objects")
 
 ABSL_FLAG (std::string, search_param, "", "The parameter, whose value is to be searched for to achieve " "targeted cpu load. For now, we have 'offered_load'. Later, " "'num_channels', 'num_outstanding_requests', etc. shall be " "added.")
 
static double grpc::testing::BinarySearch (Scenario *scenario, double targeted_cpu_load, double low, double high, const std::map< std::string, std::string > &per_worker_credential_types, bool *success)
 
static std::map< std::string, std::string > grpc::testing::ConstructPerWorkerCredentialTypesMap ()
 
static double grpc::testing::GetCpuLoad (Scenario *scenario, double offered_load, const std::map< std::string, std::string > &per_worker_credential_types, bool *success)
 
int main (int argc, char **argv)
 
static bool grpc::testing::QpsDriver ()
 
static std::unique_ptr< ScenarioResult > grpc::testing::RunAndReport (const Scenario &scenario, const std::map< std::string, std::string > &per_worker_credential_types, bool *success)
 
static double grpc::testing::SearchOfferedLoad (double initial_offered_load, double targeted_cpu_load, Scenario *scenario, const std::map< std::string, std::string > &per_worker_credential_types, bool *success)
 

Function Documentation

◆ ABSL_FLAG() [1/14]

ABSL_FLAG ( bool  ,
quit  ,
false  ,
"Quit the workers  
)

◆ ABSL_FLAG() [2/14]

ABSL_FLAG ( bool  ,
run_inproc  ,
false  ,
"Perform an in-process transport test  
)

◆ ABSL_FLAG() [3/14]

ABSL_FLAG ( double  ,
error_tolerance  ,
0.  01,
"Defines threshold for stopping the search. When current search " "range is narrower than the error_tolerance computed  range,
we " "stop the search."   
)

◆ ABSL_FLAG() [4/14]

ABSL_FLAG ( double  ,
initial_search_value  ,
0.  0,
"initial parameter value to start the search with (i.e. lower bound)"   
)

◆ ABSL_FLAG() [5/14]

ABSL_FLAG ( double  ,
stride  ,
,
"Defines each stride of the search. The larger the stride  is,
" "the coarser the result will  be,
but will also be faster."   
)

◆ ABSL_FLAG() [6/14]

ABSL_FLAG ( double  ,
targeted_cpu_load  ,
70.  0,
"Targeted cpu load (unit: %, range [0,100])"   
)

◆ ABSL_FLAG() [7/14]

ABSL_FLAG ( int32_t  ,
median_latency_collection_interval_millis  ,
,
"Specifies the period between gathering latency medians in " "milliseconds. The medians will be logged out on the client at the " "end of the benchmark run. If  0,
this periodic collection is disabled."   
)

◆ ABSL_FLAG() [8/14]

ABSL_FLAG ( std::string  ,
credential_type  ,
grpc::testing::kInsecureCredentialsType  ,
"Credential type for communication with workers  
)

◆ ABSL_FLAG() [9/14]

ABSL_FLAG ( std::string  ,
json_file_out  ,
""  ,
"File to write the JSON output to."   
)

◆ ABSL_FLAG() [10/14]

ABSL_FLAG ( std::string  ,
per_worker_credential_types  ,
""  ,
"A map of QPS worker addresses to credential types. When creating a " "channel to a QPS worker's driver  port,
the qps_json_driver first checks " "if the 'name:port' string is in the  map,
and it uses the corresponding " "credential type if so. If the QPS worker 's 'name:port' string is not " "in the  map,
then the driver -> worker channel will be created with " "the credentials specified in --credential_type. The value of this flag " "is a semicolon-separated list of map  entries,
where each map entry is " "a comma-separated pair."   
)

◆ ABSL_FLAG() [11/14]

ABSL_FLAG ( std::string  ,
qps_server_target_override  ,
""  ,
"Override QPS server target to configure in client configs." "Only applicable if there is a single benchmark server."   
)

◆ ABSL_FLAG() [12/14]

ABSL_FLAG ( std::string  ,
scenarios_file  ,
""  ,
"JSON file containing an array of Scenario objects"   
)

◆ ABSL_FLAG() [13/14]

ABSL_FLAG ( std::string  ,
scenarios_json  ,
""  ,
"JSON string containing an array of Scenario objects"   
)

◆ ABSL_FLAG() [14/14]

ABSL_FLAG ( std::string  ,
search_param  ,
""  ,
"The  parameter,
whose value is to be searched for to achieve " "targeted cpu load. For  now,
we have 'offered_load'.  Later,
" " 'num_channels'  ,
'num_outstanding_requests'  ,
etc. shall be " "added."   
)

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 298 of file qps_json_driver.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:27