Update plots

Issue-ID: CPS-2492

Change-Id: Ie972eebca1ce7ef5fc7768b22d7037767bde6133
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 5c34bd8..ef7c7de 100755
--- a/jjb/onap/cps/prepare-k6-performance-tests-plots.sh
+++ b/jjb/onap/cps/prepare-k6-performance-tests-plots.sh
@@ -127,21 +127,16 @@
 
   if [ "$numberOfBuilds" -eq 100 ]; then
     cat <<EOT >>gnuplot_script.gp
-plot '<(tail -n $numberOfBuilds $dataFile)' using 1:2 with lines linestyle 2 title "threshold", \
-     '<(tail -n $numberOfBuilds $dataFile)' using 1:3 with lines linestyle 3 title "cps-limit", \
-     '<(tail -n $numberOfBuilds $dataFile)' using 1:4:xtic(1) with linespoints linestyle 4 title "measured"
-EOT
-  elif [ "$numberOfBuilds" -eq 168 ]; then
-    cat <<EOT >>gnuplot_script.gp
-plot '<(tail -n $numberOfBuilds $dataFile | awk "NR % 2 == 0")' using 1:2 with lines linestyle 2 title "threshold", \
-     '<(tail -n $numberOfBuilds $dataFile | awk "NR % 2 == 0")' using 1:3 with lines linestyle 3 title "cps-limit", \
-     '<(tail -n $numberOfBuilds $dataFile | awk "NR % 2 == 0")' using 1:4:xtic(1) with linespoints linestyle 4 title "measured"
+plot '$dataFile' using 1:2 with lines linestyle 2 title "threshold", \
+     '$dataFile' using 1:3 with lines linestyle 3 title "cps-limit", \
+     '$dataFile' using 1:4:xtic(1) with linespoints linestyle 4 title "measured"
 EOT
   elif [ "$numberOfBuilds" -eq 720 ]; then
     cat <<EOT >>gnuplot_script.gp
-plot '<(tail -n $numberOfBuilds $dataFile | awk "NR % 7 == 0")' using 1:2 with lines linestyle 2 title "threshold", \
-     '<(tail -n $numberOfBuilds $dataFile | awk "NR % 7 == 0")' using 1:3 with lines linestyle 3 title "cps-limit", \
-     '<(tail -n $numberOfBuilds $dataFile | awk "NR % 7 == 0")' using 1:4:xtic(1) with linespoints linestyle 4 title "measured"
+unset xtics
+plot '$dataFile' using 1:2 with lines linestyle 2 title "threshold", \
+     '$dataFile' using 1:3 with lines linestyle 3 title "cps-limit", \
+     '$dataFile' using 1:4 with lines linestyle 4 title "measured"
 EOT
   fi
 
@@ -164,7 +159,7 @@
     if (max == 0) {
       max = 1;
     }
-    print max * 1.5;
+    print max * 1.2;
   }' "$dataFile"
 }
 
@@ -189,7 +184,10 @@
   while IFS=, read -r test_case test_name units; do
     dataFile="data/$test_case.csv"
     # Plot the image (graph) in png format
-    buildPlotImage "$dataFile" "data/${test_case}_${numberOfBuilds}.png" "$units" "$numberOfBuilds"
+    csvFile="data/${test_case}_${numberOfBuilds}.csv"
+    pngFile="data/${test_case}_${numberOfBuilds}.png"
+    tail -n $numberOfBuilds $dataFile > "$csvFile"
+    buildPlotImage "$csvFile" "$pngFile" "$units" "$numberOfBuilds"
     # Output to HTML
     cat <<EOF >>"$outputFile"
       <tr>
@@ -241,7 +239,6 @@
     done
   else
     echo "No new builds to process."
-    exit
   fi
 fi
 
@@ -249,10 +246,6 @@
 outputFileDaily="k6TestsPerformanceReview.html"
 generateHtmlReport "$reportTitleDaily" "$outputFileDaily" "100"
 
-reportTitleWeekly="weekly k6 tests performance review"
-outputFileWeekly="k6TestsPerformanceReviewWeekly.html"
-generateHtmlReport "$reportTitleWeekly" "$outputFileWeekly" "168"
-
 reportTitleMonthly="monthly k6 tests performance review"
 outputFileMonthly="k6TestsPerformanceReviewMonthly.html"
 generateHtmlReport "$reportTitleMonthly" "$outputFileMonthly" "720"
diff --git a/jjb/onap/global-templates-onap-java.yaml b/jjb/onap/global-templates-onap-java.yaml
index d78d54b..2df551b 100644
--- a/jjb/onap/global-templates-onap-java.yaml
+++ b/jjb/onap/global-templates-onap-java.yaml
@@ -197,7 +197,7 @@
       - html-publisher:
           name: "K6 Performance Review"
           dir: "."
-          files: "k6TestsPerformanceReview.html,k6TestsPerformanceReviewWeekly.html,k6TestsPerformanceReviewMonthly.html"
+          files: "k6TestsPerformanceReview.html,k6TestsPerformanceReviewMonthly.html"
 
 # A job to perform performance test which are based on Spock-Groovy Framework on cps project
 - job-template: