3 # A small script to help visualizing CPU usage over time data collected on CI
6 # This script is expected to be called with two arguments. The first is the full
7 # commit SHA of the build you're interested in, and the second is the name of
8 # the builder. For example:
10 # ./src/etc/cpu-usage-over-time-plot.sh e699ea096fcc2fc9ce8e8bcf884e11496a31cc9f i686-mingw-1
12 # That will generate `$builder.png` in the current directory which you can open
13 # up to see a hopefully pretty graph.
15 # Improvements to this script are greatly appreciated!
23 curl -O https://$bucket.s3.amazonaws.com/rustc-builds/$commit/cpu-$builder.csv
27 set timefmt '%Y-%m-%dT%H:%M:%S'
29 set ylabel "CPU Usage %"
32 set term png size 3000,1000
33 set output "$builder.png"
37 fit f(x) 'cpu-$builder.csv' using 1:(100-\$2) via mean_y
39 set label 1 gprintf("Average = %g%%", mean_y) center font ",18"
40 set label 1 at graph 0.50, 0.25
41 set xtics rotate by 45 offset -2,-2.4 300
46 mean_y with lines linetype 1 linecolor rgb "#ff0000" title "average", \\
47 "cpu-$builder.csv" using 1:(100-\$2) with points pointtype 7 pointsize 0.4 title "$builder", \\
48 "" using 1:(100-\$2) smooth bezier linewidth 3 title "bezier"