From: halil.cakal Date: Tue, 24 Sep 2024 14:35:29 +0000 (+0100) Subject: set fixed value for y-axis X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;h=14089ff122e688cc4af5871101b73f1b9f139155;p=infra%2Fcicd.git 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 --- diff --git a/jjb/onap/cps/prepare-k6-performance-tests-plots.sh b/jjb/onap/cps/prepare-k6-performance-tests-plots.sh index 90c29b43..0b3bf936 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 @@ EOT 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" }