vizualisation: Add tf-main vizualization script
Add `tf-a-main-results.{bash,plot}` to fetch test results from a Jenkins
build of tf-main and vizualise them. Update README.rst with usage info
for the new script and plot description.
Change-Id: I837a2dcb4cd3247b24ba9eec6557699e9a75e9c2
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
diff --git a/script/graphs/tf-main-results.plot b/script/graphs/tf-main-results.plot
new file mode 100644
index 0000000..3c8e345
--- /dev/null
+++ b/script/graphs/tf-main-results.plot
@@ -0,0 +1,58 @@
+#
+# Copyright (c) 2022 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# Determine the number of test groups, scale the terminal based on the number
+# of these.
+groups=system(sprintf("awk -F ',' 'NR!=1 {print $1}' %s | sort | uniq", ARG1))
+group_count=words(groups)
+
+# Terminal height should scale with the number of groups
+# (each group has a plot).
+set terminal pngcairo enhanced size 5400,9600 font ',14'
+
+set xrange [0:5<*] extend
+set ytic scale 0 nomirror
+set grid xtics
+set lmargin 70
+set bmargin 5
+set yrange [:] reverse
+set offsets 0,0,0.5,0.5
+set datafile separator ","
+
+set key autotitle columnhead
+
+# Create linetypes for coloured labels
+set linetype 1 linecolor "red"
+set linetype 2 linecolor "black"
+fill(n) = word("green red orange gray", n)
+
+set multiplot title "TF-A CI Test Results: " . jenkins_id \
+ font ",30" layout ceil(group_count/3.0),3
+
+ set style data histograms
+ set style fill solid 0.3 border -1
+ set key outside left vertical
+ set label "Test Suites" at screen 0.05,0.5 \
+ center front rotate font ",20"
+
+ do for [group in groups]{
+ set title group font ",18"
+ set style histogram rowstacked
+ filter = "awk -F, 'NR==1 || $1==\"".group."\"'"
+ col_count = 8
+ box_width = 0.5
+
+ plot for [col=5:col_count] '< '.filter.' '.ARG1 u col:0: \
+ (sum [i=5:col-1] column(i)): \
+ (sum [i=5:col] column(i)): \
+ ($0-box_width/2.):($0+box_width/2.):ytic(2) w boxxyerror \
+ ti columnhead(col) lc rgb fill(col-4)
+
+ unset key
+ }
+
+unset multiplot
+