xref: /aosp_15_r20/external/grpc-grpc/tools/profiling/qps/qps_scenarios.py (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1# Copyright 2017 gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14""" QPS Scenarios to run """
15
16_SCENARIOS = {
17    "large-message-throughput": (
18        '{"scenarios":[{"name":"large-message-throughput",'
19        ' "spawn_local_worker_count": -2, "warmup_seconds": 30,'
20        ' "benchmark_seconds": 270, "num_servers": 1, "server_config":'
21        ' {"async_server_threads": 1, "security_params": null, "server_type":'
22        ' "ASYNC_SERVER"}, "num_clients": 1, "client_config": {"client_type":'
23        ' "ASYNC_CLIENT", "security_params": null, "payload_config":'
24        ' {"simple_params": {"resp_size": 1048576, "req_size": 1048576}},'
25        ' "client_channels": 1, "async_client_threads": 1,'
26        ' "outstanding_rpcs_per_channel": 1, "rpc_type": "UNARY",'
27        ' "load_params": {"closed_loop": {}}, "histogram_params":'
28        ' {"max_possible": 60000000000.0, "resolution": 0.01}}}]}'
29    ),
30    "multi-channel-64-KiB": (
31        '{"scenarios":[{"name":"multi-channel-64-KiB",'
32        ' "spawn_local_worker_count": -3, "warmup_seconds": 30,'
33        ' "benchmark_seconds": 270, "num_servers": 1, "server_config":'
34        ' {"async_server_threads": 31, "security_params": null, "server_type":'
35        ' "ASYNC_SERVER"}, "num_clients": 2, "client_config": {"client_type":'
36        ' "ASYNC_CLIENT", "security_params": null, "payload_config":'
37        ' {"simple_params": {"resp_size": 65536, "req_size": 65536}},'
38        ' "client_channels": 32, "async_client_threads": 31,'
39        ' "outstanding_rpcs_per_channel": 100, "rpc_type": "UNARY",'
40        ' "load_params": {"closed_loop": {}}, "histogram_params":'
41        ' {"max_possible": 60000000000.0, "resolution": 0.01}}}]}'
42    ),
43}
44