MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / measure_case

Function measure_case

tools/provenance-eval/run.py:295–314  ·  view source on GitHub ↗
(binary, name, config, payload_bytes)

Source from the content-addressed store, hash-verified

293
294
295def 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
317def summarize(rows):

Callers 1

mainFunction · 0.85

Calls 5

startMethod · 0.95
closeMethod · 0.95
measure_turnFunction · 0.85
FixtureClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected