Skip to content

Commit bb19b82

Browse files
committed
print less on benchmarks
1 parent 97cfc50 commit bb19b82

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

scripts/benchmark-iiif.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ run_matrix() {
273273
if [ "$APPEND_RUN_REPORTS" = "1" ]; then
274274
append_matrix_reports "$index"
275275
fi
276-
echo "Benchmark matrix complete: $OUT_DIR"
277-
echo "Report: $index"
278-
cat "$index"
276+
if [ "$PRINT_REPORT" = "1" ]; then
277+
python3 "$ROOT_DIR/scripts/extract-benchmark-tldr.py" "$index"
278+
fi
279279
}
280280

281281
concurrency_list_for_mode() {
@@ -333,6 +333,14 @@ def fmt_ms(value):
333333
def fmt_cpu_ms(value):
334334
return "-" if value is None else f"{value * 1000:.2f}"
335335
336+
def fmt_s(value):
337+
return "-" if value is None else f"{value:.2f}"
338+
339+
def fmt_rate_per_s(count, duration):
340+
if not count or not duration:
341+
return "-"
342+
return f"{count / duration:.1f}"
343+
336344
def fmt_size(value):
337345
if value is None:
338346
return "-"
@@ -413,7 +421,8 @@ for run_json in sorted(out_root.glob(f"{run_id}-*/run.json")):
413421
run.get("mode", "-"),
414422
str(run.get("concurrency", "-")),
415423
fmt_rate(triplet["ok"], triplet["total"]),
416-
fmt_ms(statistics.median(triplet_times) if triplet_times else None),
424+
fmt_s(duration if duration > 0 else None),
425+
fmt_rate_per_s(triplet["ok"], duration),
417426
fmt_ms(percentile(triplet_times, 0.95)),
418427
fmt_ms(percentile(triplet_times, 0.99)),
419428
fmt_cpu_ms(cpu_per_request),
@@ -449,8 +458,8 @@ if summary_rows:
449458
"",
450459
f"Triplet image: `{', '.join(sorted(triplet_images))}`",
451460
"",
452-
"| Mode | Concurrency | Triplet OK | Median ms | p95 ms | p99 ms | CPU ms/req | Max MiB |",
453-
"| --- | ---: | --- | ---: | ---: | ---: | ---: | ---: |",
461+
"| Mode | Concurrency | Triplet OK | Duration s | Req/s | p95 ms | p99 ms | CPU ms/req | Max MiB |",
462+
"| --- | ---: | --- | ---: | ---: | ---: | ---: | ---: | ---: |",
454463
]
455464
for item in sorted(summary_rows, key=sort_key):
456465
lines.append("| " + " | ".join(item["row"]) + " |")
@@ -650,14 +659,8 @@ PY
650659
python3 "$ROOT_DIR/scripts/benchmark-stats-summary.py" "$OUT_DIR/container-stats.jsonl" "$OUT_DIR/resource-summary.csv"
651660
python3 "$ROOT_DIR/scripts/benchmark-report.py" "$OUT_DIR/requests.csv" "$OUT_DIR/resource-summary.csv" "$OUT_DIR/run.json" "$OUT_DIR/report.md"
652661
if [ "$PRINT_REPORT" = "1" ]; then
653-
cat "$OUT_DIR/report.md"
662+
python3 "$ROOT_DIR/scripts/extract-benchmark-tldr.py" "$OUT_DIR/report.md"
654663
fi
655-
echo "Benchmark complete: $OUT_DIR"
656-
echo "Request timings: $OUT_DIR/requests.csv"
657-
echo "Summary: $OUT_DIR/summary.csv"
658-
echo "Resource summary: $OUT_DIR/resource-summary.csv"
659-
echo "Report: $OUT_DIR/report.md"
660-
echo "Container stats: $OUT_DIR/container-stats.jsonl"
661664
}
662665

663666
main "$@"

scripts/benchmark-stats-summary.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import sys
77
from collections import defaultdict
88

9-
109
UNITS = {
1110
"B": 1,
1211
"KiB": 1024,

0 commit comments

Comments
 (0)