From: halil.cakal Date: Fri, 14 Jun 2024 16:28:29 +0000 (+0100) Subject: Enhance shell to handle server error X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;h=7ae89342afa25410490f639364c867a6aeca8620;p=infra%2Fcicd.git Enhance shell to handle server error - handle error scenarios when the values not being recorded into the local-file for any reason - set x-axis to rotate Issue-ID: CPS-2244 Change-Id: Iaeab115677c81d5a370e7f9d043aa6ed087a6e6a 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 0d150e50..ce85431d 100755 --- a/jjb/onap/cps/prepare-k6-performance-tests-plots.sh +++ b/jjb/onap/cps/prepare-k6-performance-tests-plots.sh @@ -136,7 +136,7 @@ getAndRecordDataResults() { newLine="$limit_value,$buildNumber,$actual" if [ -z "$actual" ]; then # No entry found for this build, the default added as zero - echo "$limit_value,$buildNumber,0" >>"$dataFile" + echo "0,$buildNumber,0" >>"$dataFile" recordLatestRecordedBuild "$buildNumber" elif [ "$newLine" == "$lastLine" ]; then # Entry already exists @@ -163,7 +163,6 @@ buildPlotImage() { # Read the first line of the file first_line=$(head -n 1 "$dataFile") - # Set upper limit of the graphs to %20 to have more space above the plot ten_percent=1.2 limit=$(echo "$first_line" | cut -d ',' -f 1) @@ -177,6 +176,7 @@ set output "${chartFileName}" set xlabel "Build" set ylabel "Limit (ms)" set yrange [0 : ${limit} < *] +set xtics rotate plot '$dataFile' using 2:3:xtic(sprintf("%d", column(2))) with linespoints title "measured", \ '$dataFile' using 2:1 with lines linestyle 2 title "limit" EOT @@ -220,8 +220,8 @@ done # Close the HTML file cat <>"$outputFile" -

The k6 job at 7:15 a.m. once a day, providing performance metrics.

-

The following graphs being updated at 7:45 a.m. once a day.

+

The k6 performance tests runs every hour, providing performance metrics to the plots.

+

The k6 plots is being updated 31 minutes past every hour.

Successful performance tests job build adds new data, but even if a build fails, existing data is retained.