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

Function validate_report

tools/materialize-bench/run.py:28–40  ·  view source on GitHub ↗
(report, iterations)

Source from the content-addressed store, hash-verified

26
27
28def validate_report(report, iterations):
29 expected = {(case, backend, iteration) for case in CASES
30 for backend in ('graph', 'span') for iteration in range(iterations)}
31 seen = set()
32 for sample in report['samples']:
33 key = (sample['case'], sample['backend'], sample['iteration'])
34 if key not in expected or key in seen:
35 raise ValueError('unexpected or duplicate sample: ' + repr(key))
36 seen.add(key)
37 if not isinstance(sample['total_ns'], int) or sample['total_ns'] <= 0:
38 raise ValueError('nonpositive or invalid sample duration')
39 if seen != expected:
40 raise ValueError('not all paired cases produced samples')
41
42
43def digest(path):

Callers 1

mainFunction · 0.70

Calls 3

rangeFunction · 0.85
setFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected