| 293 | |
| 294 | |
| 295 | def measure_case(binary, name, config, payload_bytes): |
| 296 | fixture = None |
| 297 | with tempfile.TemporaryDirectory(prefix="atomic-provenance-perf-") as temp: |
| 298 | root = pathlib.Path(temp) |
| 299 | try: |
| 300 | fixture = Fixture(binary, root) |
| 301 | fixture.start() |
| 302 | ledger = [] |
| 303 | turns = [] |
| 304 | for turn in range(1, config["turns"] + 1): |
| 305 | row, ledger = measure_turn(fixture, config, payload_bytes, turn, ledger) |
| 306 | turns.append(row) |
| 307 | if not row["checkpoint_ok"]: |
| 308 | break |
| 309 | result = {"scenario": name, "config": config, "turns": turns} |
| 310 | finally: |
| 311 | if fixture is not None: |
| 312 | logs = fixture.close() |
| 313 | result["owner_log"] = logs |
| 314 | return result |
| 315 | |
| 316 | |
| 317 | def summarize(rows): |