Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
YassinEldeeb committed Nov 27, 2024
1 parent d22750c commit 7925839
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/baseline_http_bench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7925839

Please sign in to comment.