From 7925839d88fe18f46aae831991ddfe0d49d5f09b Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Wed, 27 Nov 2024 14:58:53 +0000 Subject: [PATCH] fix --- .github/workflows/baseline_http_bench.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/baseline_http_bench.yaml b/.github/workflows/baseline_http_bench.yaml index 9ebd2979..c93b328a 100644 --- a/.github/workflows/baseline_http_bench.yaml +++ b/.github/workflows/baseline_http_bench.yaml @@ -76,18 +76,19 @@ jobs: - name: Generate Markdown Report id: generate-report run: | + # Extract values from JSON ACTIX_RPS=$(jq '.metrics.http_reqs.rate' actix_results.json) - ACTIX_P95=$(jq '.metrics.http_req_duration.percentiles["95.0"] // "null"' actix_results.json) + ACTIX_P95=$(jq '.metrics.http_req_duration["p(95)"]' actix_results.json) CONDUCTOR_RPS=$(jq '.metrics.http_reqs.rate' conductor_results.json) - CONDUCTOR_P95=$(jq '.metrics.http_req_duration.percentiles["95.0"] // "null"' conductor_results.json) + CONDUCTOR_P95=$(jq '.metrics.http_req_duration["p(95)"]' conductor_results.json) - # Handle rounding or fallback to "N/A" - ACTIX_RPS_ROUNDED=$(printf "%.0f" $ACTIX_RPS) - ACTIX_P95_ROUNDED=$(if [[ $ACTIX_P95 == "null" ]]; then echo "N/A"; else printf "%.0f" $ACTIX_P95; fi) - CONDUCTOR_RPS_ROUNDED=$(printf "%.0f" $CONDUCTOR_RPS) - CONDUCTOR_P95_ROUNDED=$(if [[ $CONDUCTOR_P95 == "null" ]]; then echo "N/A"; else printf "%.0f" $CONDUCTOR_P95; fi) + # Handle potential nulls or missing values + ACTIX_RPS_ROUNDED=$(printf "%.0f" ${ACTIX_RPS:-0}) + ACTIX_P95_ROUNDED=$(printf "%.0f" ${ACTIX_P95:-0}) + CONDUCTOR_RPS_ROUNDED=$(printf "%.0f" ${CONDUCTOR_RPS:-0}) + CONDUCTOR_P95_ROUNDED=$(printf "%.0f" ${CONDUCTOR_P95:-0}) - # Generate the Markdown report + # Generate Markdown report echo "## Benchmark Results" > benchmark_results.md echo "| Implementation | Requests/sec | P95 Latency (ms) |" >> benchmark_results.md echo "|----------------|--------------|------------------|" >> benchmark_results.md