Skip to content

Commit

Permalink
feat: report cpu diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantxie committed May 28, 2024
1 parent 1fb65ce commit 982478b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
8 changes: 5 additions & 3 deletions scripts/reports/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import sys

'''CSV Format Example
Kind,Concurrency,Data Size,TPS,P99,P999
[GRPC],100,1024,101152.29,3.36,5.30
Kind,Concurrency,Data Size,TPS,P99,P999,Server_CPU,Client_CPU
[GRPC],100,1024,101152.29,3.36,5.30,188.04,423.07
'''


Expand All @@ -23,7 +23,7 @@ class bcolors:
def diff(from_csv, to_csv):
from_reader = list(csv.reader(open(from_csv)))
to_reader = csv.reader(open(to_csv))
title = ['Kind', 'Concurrency', 'Data Size', 'QPS', 'P99', 'P999']
title = ['Kind', 'Concurrency', 'Data Size', 'QPS', 'P99', 'P999', 'Client CPU', 'Server CPU']
results = []

for line_num, line in enumerate(to_reader):
Expand All @@ -35,6 +35,8 @@ def diff(from_csv, to_csv):
result.append(diff_cell(from_reader[line_num][3], line[3])) # tps
result.append(diff_cell(from_reader[line_num][4], line[4])) # p99
result.append(diff_cell(from_reader[line_num][5], line[5])) # p999
result.append(diff_cell(from_reader[line_num][6], line[6])) # Client CPU
result.append(diff_cell(from_reader[line_num][7], line[7])) # Server CPU

results.append(result)

Expand Down
2 changes: 1 addition & 1 deletion scripts/reports/to_csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# csv
# usage: to_csv.sh xxx.log
grep TPS "$1" | awk -F '[ :,]+' '{split($6,a,"m");split($8,b,"m");print $2","substr($11,3)","substr($9,4)","$4","a[1]","b[1]}'
grep -A5 TPS "$1" | awk 'NR==1 {word1=$2" "$11" "$9" "$4" "$6" "$8} NR==2 {word2=$14} NR==4 {word3=$14} END {print word1, word2, word3}' | awk '{gsub(/[:c=,(b=msAVG%]/, "")} 1' | awk '{gsub(" ", ",")} 1'
14 changes: 8 additions & 6 deletions scripts/run_grpc_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ source $CURDIR/build_grpc.sh
# benchmark
for b in ${body[@]}; do
for c in ${concurrent[@]}; do
for ((i = 0; i < ${#repo[@]}; i++)); do
rp=${repo[i]}
addr="${ip}:${ports[i]}"
for q in ${qps[@]}; do
for ((i = 0; i < ${#repo[@]}; i++)); do
rp=${repo[i]}
addr="${ip}:${ports[i]}"

# run client
echo "Client [$rp] running with [$taskset_client]"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -n=$n --sleep=$sleep | $tee_cmd
# run client
echo "Client [$rp] running with [$taskset_client]"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -qps=$q -n=$n --sleep=$sleep | $tee_cmd
done
done
done
done
Expand Down
14 changes: 8 additions & 6 deletions scripts/run_pb_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ source $CURDIR/build_pb.sh
# benchmark
for b in ${body[@]}; do
for c in ${concurrent[@]}; do
for ((i = 0; i < ${#repo[@]}; i++)); do
rp=${repo[i]}
addr="${ip}:${ports[i]}"
for q in ${qps[@]}; do
for ((i = 0; i < ${#repo[@]}; i++)); do
rp=${repo[i]}
addr="${ip}:${ports[i]}"

# run client
echo "Client [$rp] running with [$taskset_client]"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -n=$n --sleep=$sleep | $tee_cmd
# run client
echo "Client [$rp] running with [$taskset_client]"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -qps=$q -n=$n --sleep=$sleep | $tee_cmd
done
done
done
done
Expand Down
18 changes: 10 additions & 8 deletions scripts/run_thrift_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ source $CURDIR/build_thrift.sh
# benchmark
for b in ${body[@]}; do
for c in ${concurrent[@]}; do
for ((i = 0; i < ${#repo[@]}; i++)); do
rp=${repo[i]}
addr="${ip}:${ports[i]}"
for q in ${qps[@]}; do
for ((i = 0; i < ${#repo[@]}; i++)); do
rp=${repo[i]}
addr="${ip}:${ports[i]}"

# run client
echo "Client [$rp] running with [$cmd_client]"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -n=$n --sleep=$sleep | $tee_cmd
# run client
echo "Client [$rp] running with [$cmd_client]"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -qps=$q -n=$n --sleep=$sleep | $tee_cmd

echo "client $rp running with $cmd_client"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -n=$n --sleep=$sleep | $tee_cmd
echo "client $rp running with $cmd_client"
$cmd_client $output_dir/bin/${rp}_bencher -addr="$addr" -b=$b -c=$c -qps=$q -n=$n --sleep=$sleep | $tee_cmd
done
done
done
done
Expand Down

0 comments on commit 982478b

Please sign in to comment.