From 4243f737acefa37d599ae4f14f0046956340cda1 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 7 Feb 2024 11:54:34 +0000 Subject: [PATCH] Update docker/bench/run-ab.sh --- docker/bench/run-ab.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/bench/run-ab.sh b/docker/bench/run-ab.sh index 208d0da..da58eea 100644 --- a/docker/bench/run-ab.sh +++ b/docker/bench/run-ab.sh @@ -124,10 +124,10 @@ run_ab() { local result=$(ab -n $NUM_REQUESTS -c $CONCURRENCY "$url" 2>&1) local avg_time=$(echo "$result" | grep 'Time per request' | head -1 | awk '{print $4}') if [ -z "$avg_time" ] || [ "$(echo "$avg_time > ($MAX_TIME + $VARIANCE) * 1000" | bc)" -eq 1 ]; then - echo "ApacheBench test failed for $url. Average time: ${avg_time:-N/A} milliseconds." + echo "ApacheBench test failed for $url Average time: ${avg_time:-N/A} milliseconds" return 1 else - echo "ApacheBench test passed for $url. Average time: $avg_time milliseconds." + echo "ApacheBench test passed for $url Average time: $avg_time milliseconds" return 0 fi } @@ -141,10 +141,10 @@ IFS=',' read -ra URLS <<< "$TARGET_URLS" for url in "${URLS[@]}"; do mean_ttfb=$(measure_ttfb "$url") if [ -z "$mean_ttfb" ] || [ "$(echo "$mean_ttfb > $TTFB_MAX" | bc)" -eq 1 ]; then - echo "TTFB test failed for $url. Mean TTFB: ${mean_ttfb}ms exceeds maximum of ${TTFB_MAX}ms." | tee -a "$log_file" + echo "TTFB test failed for $url Mean TTFB: ${mean_ttfb}ms exceeds maximum of ${TTFB_MAX}ms" | tee -a "$log_file" failed_urls+=("TTFB failure: $url") else - echo "TTFB test passed for $url. Mean TTFB: ${mean_ttfb}ms." | tee -a "$log_file" + echo "TTFB test passed for $url Mean TTFB: ${mean_ttfb}ms" | tee -a "$log_file" fi run_ab_result=$(run_ab "$url") echo "$run_ab_result" | tee -a "$log_file"