set fixed value for y-axis
- decide the max value for y-axis based on
threshold or cps expectation
Issue-ID: CPS-2404
Change-Id: I88bd9c9cd5b637e96a13249db5ad33c6bcca397a
Signed-off-by: halil.cakal <halil.cakal@est.tech>
diff --git a/jjb/onap/cps/prepare-k6-performance-tests-plots.sh b/jjb/onap/cps/prepare-k6-performance-tests-plots.sh
index 90c29b4..0b3bf93 100755
--- a/jjb/onap/cps/prepare-k6-performance-tests-plots.sh
+++ b/jjb/onap/cps/prepare-k6-performance-tests-plots.sh
@@ -146,18 +146,19 @@
rm gnuplot_script.gp
}
-# Set upper limit of the graphs to 20% bigger than largest value to have more space above the plot
+# To set y-axis based on max of threshold or cps_expectation
findMaxPlotRange() {
dataFile="$1"
awk -F, '{
- if ($2 > max) max = $2;
- if ($3 > max) max = $3;
- if ($4 > max) max = $4;
+ if (NF == 4 && $4 != "") {
+ if ($2 > max) max = $2;
+ if ($3 > max) max = $3;
+ }
} END {
if (max == 0) {
- max = 100;
+ max = 1;
}
- print max * 1.2;
+ print max * 2;
}' "$dataFile"
}