mirror of
https://github.com/zigzap/zap.git
synced 2025-10-20 15:14:08 +00:00
improve measure_all.sh and graph.py
This commit is contained in:
parent
61fabea500
commit
9fe223cdb9
2 changed files with 20 additions and 3 deletions
12
wrk/graph.py
12
wrk/graph.py
|
@ -5,7 +5,7 @@ from matplotlib.ticker import FuncFormatter
|
|||
from collections import defaultdict
|
||||
import statistics
|
||||
|
||||
directory = "./" # Replace with the actual directory path
|
||||
directory = "./wrk" # Replace with the actual directory path
|
||||
|
||||
requests_sec = defaultdict(list)
|
||||
transfers_sec = defaultdict(list)
|
||||
|
@ -41,10 +41,18 @@ def plot(kind='', title='', ylabel='', means=None):
|
|||
plt.text(bar.get_x() + bar.get_width() / 2, yval, f'{yval:,.2f}', ha='center', va='bottom')
|
||||
|
||||
plt.tight_layout() # Adjust the spacing of the graph elements
|
||||
plt.savefig(f"{kind.lower()}_graph.png") # Save the graph as a PNG file
|
||||
png_name = f"{directory}/{kind.lower()}_graph.png"
|
||||
plt.savefig(png_name) # Save the graph as a PNG file
|
||||
print(f"Generated: {png_name}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if not os.path.isdir(".git"):
|
||||
print("Please run from root directory of the repository!")
|
||||
print("e.g. python wrk/graph.py")
|
||||
import sys
|
||||
sys.exit(1)
|
||||
|
||||
# Iterate over the files in the directory
|
||||
for filename in os.listdir(directory):
|
||||
if filename.endswith(".perflog"):
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
if [ ! -d ".git" ] ; then
|
||||
echo "This script must be run from the root directory of the repository!"
|
||||
echo "./wrk/measure_all.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SUBJECTS="zig go python sanic rust rust2 axum csharp cpp"
|
||||
|
||||
for S in $SUBJECTS; do
|
||||
L="$S.perflog"
|
||||
for R in 1 2 3 ; do
|
||||
./wrk/measure.sh $S | tee -a $L
|
||||
./wrk/measure.sh $S | tee -a wrk/$L
|
||||
done
|
||||
done
|
||||
|
||||
echo "Finished"
|
||||
|
|
Loading…
Add table
Reference in a new issue