test: add pika benchmark tools - #2663
Merged
Merged
Conversation
baerwang
reviewed
May 21, 2024
| ``` | ||
|
|
||
| 3. After the stress test is completed, parse and format the stress test data. First execute go build to compile and convert the program: | ||
| ```go |
| ``` | ||
|
|
||
| Next, execute the program to format the stress test data. If the output folder does not exist, it needs to be created manually in advance: | ||
| ```go |
| ./parser -in_dir=$(pwd)/bench_data -out_dir=$(pwd)/parsed_data | ||
| ``` | ||
| 4. Use a python script to generate a statistical chart image from the data: | ||
| ```go |
| 本工具提供了常用指标的压测命令,并支持将压测结果一键生成可视化的 svg 格式的统计图,提升压测效率。使用步骤如下: | ||
| 1、首先,压测工具使用了 Redis 官方的 memtier_benchmark,所以要选把这个工具安装好,安装流程参考官方文档:[https://github.com/RedisLabs/memtier_benchmark](https://github.com/RedisLabs/memtier_benchmark)。 | ||
| 2、接下来启动一个 Pika 进程,然后执行压测脚本进行压测: | ||
| ```go |
| sh pika_benchmark.sh -host 127.0.0.1 -port 9221 | ||
| ``` | ||
| 目前可支持以下测试参数: | ||
| ```go |
| 1. First of all, the stress testing tool uses Redis’ official memtier_benchmark, so you must choose to install this tool. For the installation process, please refer to the official documentation: [https://github.com/RedisLabs/memtier_benchmark](https://github.com /RedisLabs/memtier_benchmark). | ||
| 2. Next, start a Pika process, and then execute the stress test script to perform the stress test: | ||
|
|
||
| ```go |
| sh pika_benchmark.sh -host 127.0.0.1 -port 9221 | ||
| ``` | ||
| Currently the following test parameters are supported: | ||
| ```go |
| } | ||
|
|
||
| func writeLantencyFile(path string, data ParsedLatencyData) { | ||
| fileName := path + "/" + data.Title |
Contributor
There was a problem hiding this comment.
filepath.Join(path,data.Title)
Collaborator
Author
There was a problem hiding this comment.
filepath.Join(path,data.Title)
done
| } | ||
|
|
||
| func writeOpsFile(path string, data ParsedOpsData) { | ||
| fileName := path + "/" + data.Title |
| } | ||
| defer file.Close() | ||
|
|
||
| var ( |
Contributor
There was a problem hiding this comment.
var (
hasAllStatsLine bool
hasRequestLatencyDistributionLine bool
hasDividingLineBegin bool
res = newBenchResult(name, usePrefix)
)
Collaborator
Author
There was a problem hiding this comment.
var ( hasAllStatsLine bool hasRequestLatencyDistributionLine bool hasDividingLineBegin bool res = newBenchResult(name, usePrefix) )
done
baerwang
reviewed
May 21, 2024
| cmd_zadd=$pwd/bench_data/cmd_zadd.txt | ||
| cmd_range=$pwd/bench_data/cmd_zrange.txt | ||
|
|
||
| memtier_benchmark --server=$server --port=$port --clients=10 --requests=$requests --data-size=32 --threads=20 --ratio=0:10 --select-db=0 > $rw_0r10w |
Collaborator
Author
There was a problem hiding this comment.
这个是不是没用传参数的值?
done
baerwang
approved these changes
May 21, 2024
added 2 commits
May 21, 2024 22:38
AlexStocks
approved these changes
May 29, 2024
chejinge
pushed a commit
that referenced
this pull request
Aug 1, 2024
* add pika benchmark --------- Co-authored-by: liuyuecai <liuyuecai@360.cn>
cheniujh
pushed a commit
to cheniujh/pika
that referenced
this pull request
Sep 24, 2024
* add pika benchmark --------- Co-authored-by: liuyuecai <liuyuecai@360.cn>
cheniujh
pushed a commit
to cheniujh/pika
that referenced
this pull request
Sep 24, 2024
* add pika benchmark --------- Co-authored-by: liuyuecai <liuyuecai@360.cn>
byseea11
pushed a commit
to byseea11/pikiwidb
that referenced
this pull request
Sep 27, 2025
* add pika benchmark --------- Co-authored-by: liuyuecai <liuyuecai@360.cn>
byseea11
pushed a commit
to byseea11/pikiwidb
that referenced
this pull request
Sep 29, 2025
* add pika benchmark --------- Co-authored-by: liuyuecai <liuyuecai@360.cn>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
添加 pika benchark 工具,旨在提升压测效率,并输出可视化的统计图表。目前支持了以下的压测 case:
1、常用命令的百分位延时统计图:
2、常用命令的 OPS 统计图
3、不同读写场景下的百分位延时统计图
4、不同读写场景下的 OPS 统计图