From 4edbe59feeac6eb8d7520765e686e96af760b0d7 Mon Sep 17 00:00:00 2001 From: YangruiEmma Date: Thu, 8 Aug 2024 20:46:25 +0800 Subject: [PATCH 1/2] chore: rename env.sh to base.sh --- README.md | 4 ++-- README_cn.md | 4 ++-- scripts/{env.sh => base.sh} | 0 scripts/benchmark_generic.sh | 2 +- scripts/benchmark_grpc.sh | 2 +- scripts/benchmark_pb.sh | 2 +- scripts/benchmark_streaming.sh | 2 +- scripts/benchmark_thrift.sh | 2 +- scripts/run_grpc_clients.sh | 2 +- scripts/run_grpc_servers.sh | 2 +- scripts/run_pb_clients.sh | 2 +- scripts/run_pb_servers.sh | 2 +- scripts/run_thrift_clients.sh | 2 +- scripts/run_thrift_servers.sh | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) rename scripts/{env.sh => base.sh} (100%) diff --git a/README.md b/README.md index b2283ac..6f62dfa 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ python3 ./scripts/reports/diff.py output/2021-12-13-21-40.csv output/2021-12-13- ### Profiling -Since the default benchmark will complete quickly, to obtain enough time to do profiling, you can increase the parameter `n` in `./scripts/env.sh`. +Since the default benchmark will complete quickly, to obtain enough time to do profiling, you can increase the parameter `n` in `./scripts/base.sh`. #### Profiling Client @@ -131,7 +131,7 @@ go tool pprof localhost:{port}/debug/pprof/{pprof_type} ### More scenarios -Modify the `./scripts/env.sh` file: +Modify the `./scripts/base.sh` file: ```bash # Send pressure test request number diff --git a/README_cn.md b/README_cn.md index 63cca84..d912140 100644 --- a/README_cn.md +++ b/README_cn.md @@ -101,7 +101,7 @@ python ./scripts/reports/diff.py output/2021-12-13-21-40.csv output/2021-12-13-2 ### Profiling -由于默认压测参数会比较迅速完成一次压测,为了获得更长采集时间,可以手动在 `./scripts/env.sh` 中调整压测参数 n 大小。 +由于默认压测参数会比较迅速完成一次压测,为了获得更长采集时间,可以手动在 `./scripts/base.sh` 中调整压测参数 n 大小。 #### Profiling Client @@ -129,7 +129,7 @@ go tool pprof localhost:{port}/debug/pprof/{pprof_type} ### 更多场景测试 -修改 `./scripts/env.sh` 文件: +修改 `./scripts/base.sh` 文件: ```bash # 发送压测请求数 diff --git a/scripts/env.sh b/scripts/base.sh similarity index 100% rename from scripts/env.sh rename to scripts/base.sh diff --git a/scripts/benchmark_generic.sh b/scripts/benchmark_generic.sh index c25eb7d..9cc3880 100755 --- a/scripts/benchmark_generic.sh +++ b/scripts/benchmark_generic.sh @@ -3,7 +3,7 @@ set -e CURDIR=$(cd $(dirname $0); pwd) echo "Checking whether the environment meets the requirements ..." -source $CURDIR/env.sh +source $CURDIR/base.sh echo "Check finished." srepo=("generic_http" "generic_json" "generic_map" "generic_ordinary") diff --git a/scripts/benchmark_grpc.sh b/scripts/benchmark_grpc.sh index f095580..fd84a47 100755 --- a/scripts/benchmark_grpc.sh +++ b/scripts/benchmark_grpc.sh @@ -3,7 +3,7 @@ set -e CURDIR=$(cd $(dirname $0); pwd) echo "Checking whether the environment meets the requirements ..." -source $CURDIR/env.sh +source $CURDIR/base.sh echo "Check finished." srepo=("grpc" "kitex") diff --git a/scripts/benchmark_pb.sh b/scripts/benchmark_pb.sh index 27b5942..22567d9 100755 --- a/scripts/benchmark_pb.sh +++ b/scripts/benchmark_pb.sh @@ -3,7 +3,7 @@ set -e CURDIR=$(cd $(dirname $0); pwd) echo "Checking whether the environment meets the requirements ..." -source $CURDIR/env.sh +source $CURDIR/base.sh echo "Check finished." srepo=("grpc" "kitex" "kitex-mux" "rpcx" "arpc") diff --git a/scripts/benchmark_streaming.sh b/scripts/benchmark_streaming.sh index 1ac5373..e65d892 100755 --- a/scripts/benchmark_streaming.sh +++ b/scripts/benchmark_streaming.sh @@ -8,7 +8,7 @@ ports=(8000 8001) CURDIR=$(cd $(dirname $0); pwd) echo "Checking whether the environment meets the requirements ..." -source $CURDIR/env.sh +source $CURDIR/base.sh echo "Check finished." echo "Building streaming services by exec build_streaming.sh..." diff --git a/scripts/benchmark_thrift.sh b/scripts/benchmark_thrift.sh index 4c0f199..47e696c 100755 --- a/scripts/benchmark_thrift.sh +++ b/scripts/benchmark_thrift.sh @@ -3,7 +3,7 @@ set -e CURDIR=$(cd $(dirname $0); pwd) echo "Checking whether the environment meets the requirements ..." -source $CURDIR/env.sh +source $CURDIR/base.sh echo "Check finished." srepo=("kitex" "kitex-mux") diff --git a/scripts/run_grpc_clients.sh b/scripts/run_grpc_clients.sh index dff1a4f..e1848d4 100755 --- a/scripts/run_grpc_clients.sh +++ b/scripts/run_grpc_clients.sh @@ -6,7 +6,7 @@ ports=(8000 8006) ip=${IP:-"127.0.0.1"} # build -source $CURDIR/env.sh +source $CURDIR/base.sh source $CURDIR/build_grpc.sh # benchmark diff --git a/scripts/run_grpc_servers.sh b/scripts/run_grpc_servers.sh index 547a1b4..e841a3d 100755 --- a/scripts/run_grpc_servers.sh +++ b/scripts/run_grpc_servers.sh @@ -4,7 +4,7 @@ CURDIR=$(cd $(dirname $0); pwd) repo=("grpc" "kitex") # build -source $CURDIR/env.sh +source $CURDIR/base.sh source $CURDIR/build_grpc.sh # benchmark diff --git a/scripts/run_pb_clients.sh b/scripts/run_pb_clients.sh index ee0dc3e..3a4e44c 100755 --- a/scripts/run_pb_clients.sh +++ b/scripts/run_pb_clients.sh @@ -6,7 +6,7 @@ ports=(8000 8001 8002 8003 8004) ip=${IP:-"127.0.0.1"} # build -source $CURDIR/env.sh +source $CURDIR/base.sh source $CURDIR/build_pb.sh # benchmark diff --git a/scripts/run_pb_servers.sh b/scripts/run_pb_servers.sh index df9aa48..243bdaa 100755 --- a/scripts/run_pb_servers.sh +++ b/scripts/run_pb_servers.sh @@ -4,7 +4,7 @@ CURDIR=$(cd $(dirname $0); pwd) repo=("grpc" "kitex" "kitex-mux" "rpcx" "arpc") # build -source $CURDIR/env.sh +source $CURDIR/base.sh source $CURDIR/build_pb.sh # benchmark diff --git a/scripts/run_thrift_clients.sh b/scripts/run_thrift_clients.sh index 899af04..b89d40c 100755 --- a/scripts/run_thrift_clients.sh +++ b/scripts/run_thrift_clients.sh @@ -6,7 +6,7 @@ ports=(8001 8002) ip=${IP:-"127.0.0.1"} # build -source $CURDIR/env.sh +source $CURDIR/base.sh source $CURDIR/build_thrift.sh # benchmark diff --git a/scripts/run_thrift_servers.sh b/scripts/run_thrift_servers.sh index 4620678..0e673b4 100755 --- a/scripts/run_thrift_servers.sh +++ b/scripts/run_thrift_servers.sh @@ -4,7 +4,7 @@ CURDIR=$(cd $(dirname $0); pwd) repo=("kitex" "kitex-mux") # build -source $CURDIR/env.sh +source $CURDIR/base.sh source $CURDIR/build_thrift.sh # benchmark From ce2c1c2e209772b9651e3fb387f515ca2da709e0 Mon Sep 17 00:00:00 2001 From: YangruiEmma Date: Thu, 8 Aug 2024 21:15:09 +0800 Subject: [PATCH 2/2] fix: to_csv.sh cannot get GRPC str correctly --- scripts/reports/to_csv.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/reports/to_csv.sh b/scripts/reports/to_csv.sh index 1fcb5e6..7cccc68 100755 --- a/scripts/reports/to_csv.sh +++ b/scripts/reports/to_csv.sh @@ -4,8 +4,8 @@ # usage: to_csv.sh xxx.log output_dir=$(dirname "$1") # Kind,Concurrency,Data_Size,TPS,AVG,P99,Server_CPU,Client_CPU -grep TPS "$1" | awk '{print $2" "$13" "$11" "$4" "$6" "$8}' | awk '{gsub(/[:c=,(b=msAVG%]/, "")} 1' > $output_dir/tps.out -grep '@Server' "$1" | grep CPU | awk '{print $14}' | awk '{gsub(/[:c=,(b=msAVG%]/, "")} 1' > $output_dir/server.out -grep '@Client' "$1" | grep CPU | awk '{print $14}' | awk '{gsub(/[:c=,(b=msAVG%]/, "")} 1' > $output_dir/client.out +grep TPS "$1" | awk '{print $2" "$13" "$11" "$4" "$6" "$8}' | awk '{gsub(/[:c=,(b=ms%]/, "")} 1' > $output_dir/tps.out +grep '@Server' "$1" | grep CPU | awk '{print $14}' | awk '{gsub(/[%:]||AVG/, "")} 1' > $output_dir/server.out +grep '@Client' "$1" | grep CPU | awk '{print $14}' | awk '{gsub(/[%:]||AVG/, "")} 1' > $output_dir/client.out # combine each line, replace space by comma awk '{ lines[FNR] = lines[FNR] $0 " " } END { for (i=1; i<=FNR; i++) print lines[i] }' $output_dir/tps.out $output_dir/server.out $output_dir/client.out | awk '{ print substr($0, 1, length($0)-1) }' | awk '{gsub(" ", ",")} 1'