# Overview of performance test suite
For design of the tests, see https://grpc.io/docs/guides/benchmarking.
This document contains documentation of on how to run gRPC end-to-end benchmarks
using the gRPC OSS benchmarks framework (recommended) or how to run them
manually (for experts only).
## Approach 1: Use gRPC OSS benchmarks framework (Recommended)
### gRPC OSS benchmarks
The scripts in this section generate LoadTest configurations for the GKE-based
gRPC OSS benchmarks framework. This framework is stored in a separate
repository, [grpc/test-infra].
These scripts, together with tools defined in [grpc/test-infra], are used in the
continuous integration setup defined in [grpc_e2e_performance_gke.sh] and
[grpc_e2e_performance_gke_experiment.sh].
#### Generating scenarios
The benchmarks framework uses the same test scenarios as the legacy one. The
script [scenario_config_exporter.py](./scenario_config_exporter.py) can be used
to export these scenarios to files, and also to count and analyze existing
scenarios.
The language(s) and category of the scenarios are of particular importance to
the tests. Continuous runs will typically run tests in the `scalable` category.
The following example counts scenarios in the `scalable` category:
```
$ ./tools/run_tests/performance/scenario_config_exporter.py --count_scenarios --category=scalable
Scenario count for all languages (category: scalable):
Count Language Client Server Categories
56 c++ scalable
19 python_asyncio scalable
16 java scalable
12 go scalable
12 node scalable
9 csharp scalable
9 dotnet scalable
7 python scalable
5 ruby scalable
4 csharp c++ scalable
4 dotnet c++ scalable
4 php7 c++ scalable
4 php7_protobuf_c c++ scalable
3 python_asyncio c++ scalable
2 ruby c++ scalable
2 python c++ scalable
1 csharp c++ scalable
1 dotnet c++ scalable
170 total scenarios (category: scalable)
```
Client and server languages are only set for cross-language scenarios, where the
client or server language do not match the scenario language.
#### Generating load test configurations
The benchmarks framework uses LoadTest resources configured by YAML files. Each
LoadTest resource specifies a driver, a server, and one or more clients to run
the test. Each test runs one scenario. The scenario configuration is embedded in
the LoadTest configuration. Example configurations for various languages can be
found here:
https://github.com/grpc/test-infra/tree/master/config/samples
The script [loadtest_config.py](./loadtest_config.py) generates LoadTest
configurations for tests running a set of scenarios. The configurations are
written in multipart YAML format, either to a file or to stdout. Each
configuration contains a single embedded scenario.
The LoadTest configurations are generated from a template. Any configuration can
be used as a template, as long as it contains the languages required by the set
of scenarios we intend to run (for instance, if we are generating configurations
to run go scenarios, the template must contain a go client and a go server; if
we are generating configurations for cross-language scenarios that need a go
client and a C++ server, the template must also contain a C++ server; and the
same for all other languages).
The LoadTests specified in the script output all have unique names and can be
run by applying the test to a cluster running the LoadTest controller with
`kubectl apply`:
```
$ kubectl apply -f loadtest_config.yaml
```
> Note: The most common way of running tests generated by this script is to use
> a _test runner_. For details, see [running tests](#running-tests).
A basic template for generating tests in various languages can be found here:
[loadtest_template_basic_all_languages.yaml](./templates/loadtest_template_basic_all_languages.yaml).
The following example generates configurations for C# and Java tests using this
template, including tests against C++ clients and servers, and running each test
twice:
```
$ ./tools/run_tests/performance/loadtest_config.py -l go -l java \
-t ./tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml \
-s client_pool=workers-8core -s driver_pool=drivers \
-s server_pool=workers-8core \
-s big_query_table=e2e_benchmarks.experimental_results \
-s timeout_seconds=3600 --category=scalable \
-d --allow_client_language=c++ --allow_server_language=c++ \
--runs_per_test=2 -o ./loadtest.yaml
```
The script `loadtest_config.py` takes the following options:
- `-l`, `--language`<br> Language to benchmark. May be repeated.
- `-t`, `--template`<br> Template file. A template is a configuration file that
may contain multiple client and server configuration, and may also include
substitution keys.
- `-s`, `--substitution` Substitution keys, in the format `key=value`. These
keys are substituted while processing the template. Environment variables that
are set by the load test controller at runtime are ignored by default
(`DRIVER_PORT`, `KILL_AFTER`, `POD_TIMEOUT`). The user can override this
behavior by specifying these variables as keys.
- `-p`, `--prefix`<br> Test names consist of a prefix_joined with a uuid with a
dash. Test names are stored in `metadata.name`. The prefix is also added as
the `prefix` label in `metadata.labels`. The prefix defaults to the user name
if not set.
- `-u`, `--uniquifier_element`<br> Uniquifier elements may be passed to the test
to make the test name unique. This option may be repeated to add multiple
elements. The uniquifier elements (plus a date string and a run index, if
applicable) are joined with a dash to form a _uniquifier_. The test name uuid
is derived from the scenario name and the uniquifier. The uniquifier is also
added as the `uniquifier` annotation in `metadata.annotations`.
- `-d`<br> This option is a shorthand for the addition of a date string as a
uniquifier element.
- `-a`, `--annotation`<br> Metadata annotation to be stored in
`metadata.annotations`, in the form key=value. May be repeated.
- `-r`, `--regex`<br> Regex to select scenarios to run. Each scenario is
embedded in a LoadTest configuration containing a client and server of the
language(s) required for the test. Defaults to `.*`, i.e., select all
scenarios.
- `--category`<br> Select scenarios of a specified _category_, or of all
categories. Defaults to `all`. Continuous runs typically run tests in the
`scalable` category.
- `--allow_client_language`<br> Allows cross-language scenarios where the client
is of a specified language, different from the scenario language. This is
typically `c++`. This flag may be repeated.
- `--allow_server_language`<br> Allows cross-language scenarios where the server
is of a specified language, different from the scenario language. This is
typically `node` or `c++`. This flag may be repeated.
- `--instances_per_client`<br> This option generates multiple instances of the
clients for each test. The instances are named with the name of the client
combined with an index (or only an index, if no name is specified). If the
template specifies more than one client for a given language, it must also
specify unique names for each client. In the most common case, the template
contains only one unnamed client for each language, and the instances will be
named `0`, `1`, ...
- `--runs_per_test`<br> This option specifies that each test should be repeated
`n` times, w
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#).zip (2000个子文件)
credentials.h 53KB
client_callback.h 47KB
async_stream.h 45KB
sync_stream.h 36KB
server_callback_handlers.h 36KB
call_op_set.h 34KB
server_callback.h 29KB
grpc.h 26KB
server_context.h 26KB
port_platform.h 24KB
event_engine.h 24KB
channel_arg_names.h 23KB
grpc_types.h 19KB
client_context.h 19KB
completion_queue.h 18KB
interceptor_common.h 17KB
async_unary_call.h 17KB
server_builder.h 17KB
method_handler.h 15KB
server_interface.h 15KB
server.h 14KB
credentials.h 13KB
sync.h 12KB
interceptor.h 11KB
tls_certificate_verifier.h 11KB
opencensus.h 10KB
slice.h 10KB
proto_buffer_writer.h 9KB
tls_credentials_options.h 9KB
service_type.h 8KB
proto_buffer_reader.h 8KB
client_interceptor.h 8KB
byte_buffer.h 8KB
otel_plugin.h 8KB
callback_common.h 8KB
memory_allocator.h 7KB
grpc_security_constants.h 6KB
slice.h 6KB
channel_interface.h 6KB
status.h 6KB
json.h 6KB
status_code_enum.h 6KB
create_channel_binder.h 6KB
slice_buffer.h 6KB
status.h 6KB
grpc_security.h 6KB
tls_certificate_provider.h 5KB
rpc_service_method.h 5KB
mock_stream.h 5KB
gcp_observability.h 5KB
channel_arguments.h 5KB
generic_stub_internal.h 5KB
generic_stub.h 5KB
slice.h 5KB
server_interceptor.h 5KB
server_metric_recorder.h 5KB
channel.h 5KB
string_ref.h 5KB
call_metric_recorder.h 4KB
proto_utils.h 4KB
csm_observability.h 4KB
server_credentials.h 4KB
atm_windows.h 4KB
config_protobuf.h 4KB
alarm.h 4KB
byte_buffer.h 4KB
time.h 4KB
slice_type.h 4KB
client_unary_call.h 4KB
compression_types.h 4KB
slice_buffer.h 4KB
xds_server_builder.h 4KB
sync.h 4KB
slice_cast.h 3KB
atm.h 3KB
grpc_crl_provider.h 3KB
auth_metadata_processor.h 3KB
atm_gcc_atomic.h 3KB
auth_context.h 3KB
delegating_channel.h 3KB
authorization_policy_provider.h 3KB
metadata_map.h 3KB
grpc_audit_logging.h 3KB
create_channel.h 3KB
intercepted_channel.h 3KB
error_details.h 3KB
callback_generic_service.h 3KB
async_generic_service.h 3KB
time.h 3KB
compression.h 3KB
call.h 3KB
memory_allocator_impl.h 3KB
message_allocator.h 2KB
atm_gcc_sync.h 2KB
log.h 2KB
binder_security_policy.h 2KB
resource_quota.h 2KB
extensible.h 2KB
rpc_method.h 2KB
grpcpp.h 2KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
嵌入式JunG
- 粉丝: 5519
- 资源: 763
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于NetCore3.1和Vue的系统管理平台.zip
- (源码)基于Arduino的蓝牙控制LED系统.zip
- SwitchResX 4.6.4 自定义分辨率 黑苹果神器
- (源码)基于Spring Boot和MyBatis的大文件分片上传系统.zip
- (源码)基于Spring Boot和MyBatis的后台管理系统.zip
- (源码)基于JDBC的Java学生管理系统.zip
- (源码)基于Arduino的教室电力节能管理系统.zip
- (源码)基于Python语言的注释格式处理系统.zip
- (源码)基于C++的嵌入式文件系统管理工具.zip
- (源码)基于JavaFX框架的动画与界面管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功