Repository navigation
webchannel/benchmark: tweak reports - #105
Conversation
There was a problem hiding this comment.
Code Review
This pull request moves the "Benchmark elapsed time by delay" table from the benchmark reports (report.md) to the artifacts metadata (artifacts.md) across several benchmark runs, updating the generator script summarize-delay-sweep.py and documentation (AGENTS.md, README.md) accordingly. The review feedback suggests using defensive dictionary lookups with fallback values in summarize-delay-sweep.py to prevent potential KeyError exceptions when parsing incomplete or modified timing data.
| for delay in delays: | ||
| artifacts.append(f"| {delay} | {timing['delays'][str(delay)]['elapsedSeconds']:.3f} |") |
There was a problem hiding this comment.
To prevent potential KeyError exceptions when processing incomplete or manually modified timing.json files, use defensive .get() lookups with a fallback placeholder (e.g., "—") for missing delay timing data.
| for delay in delays: | |
| artifacts.append(f"| {delay} | {timing['delays'][str(delay)]['elapsedSeconds']:.3f} |") | |
| for delay in delays: | |
| delay_seconds = timing.get("delays", {}).get(str(delay), {}).get("elapsedSeconds") | |
| val = f"{delay_seconds:.3f}" if delay_seconds is not None else "—" | |
| artifacts.append(f"| {delay} | {val} |") |
No description provided.