Update docker/bench/run-ab.sh

This commit is contained in:
colin 2024-02-06 20:59:30 +00:00
parent 4815fa00a3
commit dc640bc658
1 changed files with 13 additions and 12 deletions

View File

@ -97,17 +97,6 @@ for url in "${URLS[@]}"; do
fi fi
done done
if [ ${#failed_urls[@]} -gt 0 ]; then
echo "Summary of failed URLs:" | tee -a "$log_file"
for failed_url in "${failed_urls[@]}"; do
echo "- $failed_url" | tee -a "$log_file"
done
exit 1
else
echo "All URLs passed the performance and TTFB tests." | tee -a "$log_file"
exit 0
fi
parse_to_csv() { parse_to_csv() {
local input="$1" local input="$1"
local output="$2" local output="$2"
@ -138,4 +127,16 @@ upload_to_hastebin() {
echo "Failed to upload to hastebin." echo "Failed to upload to hastebin."
fi fi
} }
upload_to_hastebin "/logs/scan.csv" upload_to_hastebin "/logs/scan.csv"
if [ ${#failed_urls[@]} -gt 0 ]; then
echo "Summary of failed URLs:" | tee -a "$log_file"
for failed_url in "${failed_urls[@]}"; do
echo "- $failed_url" | tee -a "$log_file"
done
exit 1
else
echo "All URLs passed the performance and TTFB tests." | tee -a "$log_file"
exit 0
fi