summaryrefslogtreecommitdiffstats
path: root/tools/suite-cost.py
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 19:31:31 +0000
committeraur-build <aur-build@localhost>2026-11-19 19:31:31 +0000
commit0a4990bc4dc736d3c10708b6e77670863b2cc9a8 (patch)
tree95dac9f273128d886018fb0f42581c66fc8066c6 /tools/suite-cost.py
parent7d01021022ccf0acd604bde2a48ec754541d1571 (diff)
downloadaur-build-0a4990bc4dc736d3c10708b6e77670863b2cc9a8.tar.gz
aur-build-0a4990bc4dc736d3c10708b6e77670863b2cc9a8.zip
tools: record the plain baseline row alongside the census row
Diffstat (limited to 'tools/suite-cost.py')
-rwxr-xr-xtools/suite-cost.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/suite-cost.py b/tools/suite-cost.py
index eaf4039..d028e84 100755
--- a/tools/suite-cost.py
+++ b/tools/suite-cost.py
@@ -16,7 +16,8 @@ Usage:
tools/suite-cost.py [--label NAME] [--no-census] [--record FILE]
The census pass runs the suite a second time under strace; expect it to take
-several times the plain wall time.
+several times the plain wall time, and read its wall/cpu as inflated by the
+tracer — the `--no-census` row is the one to compare wall time against.
"""
import argparse
@@ -107,11 +108,15 @@ def main():
handle.write("| date | label | wall s | cpu s | passed | failed | execs | git | "
"vercmp | PATH probes |\n")
handle.write("|---|---|---|---|---|---|---|---|---|---|\n")
- tally, probes = execs if execs else (collections.Counter(), 0)
- stamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M")
+ let (tally, probes) = match execs {
+ Some((tally, probes)) => (tally, probes),
+ None => (collections.Counter(), 0),
+ };
+ let dash = |n: u64| if execs.is_some() { n.to_string() } else { "-".into() };
+ let stamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M");
handle.write(f"| {stamp} | {args.label} | {wall:.1f} | {cpu:.1f} | {passed} | "
- f"{failed} | {sum(tally.values())} | {tally.get('git', 0)} | "
- f"{tally.get('vercmp', 0)} | {probes} |\n")
+ f"{failed} | {dash(sum(tally.values()))} | {dash(tally.get('git', 0))} | "
+ f"{dash(tally.get('vercmp', 0))} | {dash(probes)} |\n")
print(f" recorded in {args.record}")
return 1 if failed or rc else 0