set fixed value for y-axis 09/22309/4 master
authorhalil.cakal <halil.cakal@est.tech>
Tue, 24 Sep 2024 14:35:29 +0000 (15:35 +0100)
committerhalil.cakal <halil.cakal@est.tech>
Wed, 25 Sep 2024 09:32:03 +0000 (10:32 +0100)
- 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>
jjb/onap/cps/prepare-k6-performance-tests-plots.sh

index 90c29b43b117ef945abf16c32f67d8dc1be6f85d..0b3bf93688498811fe19bc52a30780dcbbdf8a12 100755 (executable)
@@ -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"
 }