-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add benchmark docs benchmark.md and delete a.log
- Loading branch information
1 parent
3f3521a
commit 9dfd2db
Showing
12 changed files
with
79 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Benchmark测试 | ||
|
||
## 工作原理 | ||
与e2e测试工作原理相同,详情可见: | ||
- [e2e-test.md](./e2e-test.md) | ||
|
||
## 测试流程 | ||
|
||
### 环境准备 | ||
|
||
目前仅支持通过docker-compose搭建测试环境,在准备开始进行benchmark测试前,您首先需要准备以下内容: | ||
|
||
- 测试环境:Docker-Compose环境(需在本地安装docker-compose) | ||
|
||
### 配置文件 | ||
|
||
对于每一个新的benchmark,您需要在`./test/benchmark/test_cases/<your_scenario>`目录下创建一个新的feature配置文件。每个配置文件中可以包含多个测试场景,每个测试场景由一个或多个步骤组成。 | ||
|
||
配置文件的基本框架如下: | ||
|
||
```plain | ||
@input | ||
Feature: performance file to blackhole vector | ||
Performance file to blackhole vector | ||
@e2e-performance @docker-compose | ||
Scenario: PerformanceFileToBlackholeVector | ||
Given {docker-compose} environment | ||
Given docker-compose type {benchmark} | ||
When start docker-compose {performance_file_to_blackhole_vector} | ||
When start monitor {vector} | ||
When generate logs to file, speed {10}MB/s, total {1}min, to file {./a.log}, template | ||
""" | ||
{"url": "POST /PutData?Category=YunOsAccountOpLog HTTP/1.1", "ip": "10.200.98.220", "user-agent": "aliyun-sdk-java", "request": {"status": "200", "latency": "18204"}, "time": "07/Jul/2022:10:30:28"} | ||
""" | ||
``` | ||
|
||
- `@e2e-performance @docker-compose`: 表示测试场景为e2e-performance,测试场景由本地docker-compose运行 | ||
- `Given {docker-compose} environment`: 配置启动测试环境,以docker-compose环境启动测试 | ||
- `Given docker-compose type {benchmark}`: 配置docker-compose启动模式,以benchmark模式启动docker-compose,`{}`中参数有两种选项,`e2e`/`benchmark`。以`e2e`模式启动会默认启动ilogtail、goc-server容器,用作e2e测试;以`benchmark`模式启动会默认启动cadvisor容器,用于监控容器运行过程中的资源占用;若在配置文件中不配置该参数,则默认以上一个scenario的启动模式启动。 | ||
- `When start docker-compose {scenario directory}`: `{}`中参数为当前scenario的文件夹名,该行动作会读取`scenario director`文件夹下的docker-compose.yaml文件,通过docker-compose命令启动所有容器 | ||
- `When start monitor {vector}`: `{}`中参数为待监控的容器,该参数需要与docker-compose中的service name相同 | ||
- `When generate logs to file`: 生成测试数据,其他生成测试数据的方法请参考[e2e-test-step.md](./e2e-test-step.md) | ||
|
||
### 运行测试 | ||
|
||
在所有测试内容准备完毕后,您可以直接在test目录下以go test的方式运行E2E测试。根据您的需求,可以选择运行所有测试或者指定测试。 | ||
|
||
```shell | ||
# 运行所有benchmark测试 | ||
go test -v -timeout 30m -run ^TestE2EOnDockerComposePerformance$ github.com/alibaba/ilogtail/test/benchmark | ||
|
||
# 以正则表达式匹配Scenario运行测试,以下为运行Scenario以Vector为结尾的test_case | ||
go test -v -timeout 30m -run ^TestE2EOnDockerComposePerformance$/^.*Vector$ github.com/alibaba/ilogtail/test/benchmark | ||
``` | ||
|
||
### 测试结果 | ||
|
||
- 所有测试结果将以json格式记录在`test/benchmark/report/<your_scenario>.json`中,目前记录了测试过程中CPU最大使用率、CPU平均使用率、内存最大使用率、内存平均使用率参数。 | ||
- 运行`scripts/benchmark_collect_result.sh`会将`test/benchmark/report/`下所有结果收集并生成汇总结果到`test/benchmark/report/combines_result.json`,主要用于github benmark action收集本次测试数据并与历史数据汇总 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters