-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add pika benchmark tools #2663
Conversation
tools/pika_benchmark/README.md
Outdated
``` | ||
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tools/pika_benchmark/README.md
Outdated
``` | ||
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
tools/pika_benchmark/README.md
Outdated
./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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
tools/pika_benchmark/README_ZH.md
Outdated
本工具提供了常用指标的压测命令,并支持将压测结果一键生成可视化的 svg 格式的统计图,提升压测效率。使用步骤如下: | ||
1、首先,压测工具使用了 Redis 官方的 memtier_benchmark,所以要选把这个工具安装好,安装流程参考官方文档:[https://github.com/RedisLabs/memtier_benchmark](https://github.com/RedisLabs/memtier_benchmark)。 | ||
2、接下来启动一个 Pika 进程,然后执行压测脚本进行压测: | ||
```go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
tools/pika_benchmark/README_ZH.md
Outdated
sh pika_benchmark.sh -host 127.0.0.1 -port 9221 | ||
``` | ||
目前可支持以下测试参数: | ||
```go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
tools/pika_benchmark/README.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
tools/pika_benchmark/README.md
Outdated
sh pika_benchmark.sh -host 127.0.0.1 -port 9221 | ||
``` | ||
Currently the following test parameters are supported: | ||
```go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
tools/pika_benchmark/parser.go
Outdated
} | ||
|
||
func writeLantencyFile(path string, data ParsedLatencyData) { | ||
fileName := path + "/" + data.Title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepath.Join(path,data.Title)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepath.Join(path,data.Title)
done
tools/pika_benchmark/parser.go
Outdated
} | ||
|
||
func writeOpsFile(path string, data ParsedOpsData) { | ||
fileName := path + "/" + data.Title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
done
} | ||
defer file.Close() | ||
|
||
var ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var (
hasAllStatsLine bool
hasRequestLatencyDistributionLine bool
hasDividingLineBegin bool
res = newBenchResult(name, usePrefix)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var ( hasAllStatsLine bool hasRequestLatencyDistributionLine bool hasDividingLineBegin bool res = newBenchResult(name, usePrefix) )
done
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是不是没用传参数的值?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是不是没用传参数的值?
done
* add pika benchmark --------- Co-authored-by: liuyuecai <[email protected]>
* add pika benchmark --------- Co-authored-by: liuyuecai <[email protected]>
* add pika benchmark --------- Co-authored-by: liuyuecai <[email protected]>
添加 pika benchark 工具,旨在提升压测效率,并输出可视化的统计图表。目前支持了以下的压测 case:
1、常用命令的百分位延时统计图:
2、常用命令的 OPS 统计图
3、不同读写场景下的百分位延时统计图
4、不同读写场景下的 OPS 统计图