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
if (max == 0) {
max = 1;
}
- print max * 1.5;
+ print max * 1.2;
}' "$dataFile"
}
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>
done
else
echo "No new builds to process."
- exit
fi
fi
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"