Bug 1880804 [wpt PR 44645] - Implement constructor in RTCEncodedVideoFrame, a=testonly
[gecko.git] / testing / gtest / bench.py
blobe63e4910803bab6f5adc4d3b36dd321ce04adc35
1 #!/usr/bin/env python3
3 import json
4 import statistics
5 import subprocess
6 import sys
8 proc = subprocess.Popen(["./mach", "gtest", sys.argv[1]], stdout=subprocess.PIPE)
9 for line in proc.stdout:
10 if line.startswith(b"PERFHERDER_DATA:"):
11 data = json.loads(line[len("PERFHERDER_DATA:") :].decode("utf8"))
12 for suite in data["suites"]:
13 for subtest in suite["subtests"]:
14 # pylint --py3k W1619
15 print(
16 "%4d.%03d ± %6s ms %s.%s"
17 % (
18 subtest["value"] / 1000.0,
19 subtest["value"] % 1000,
20 "%.3f" % (statistics.stdev(subtest["replicates"]) / 1000),
21 suite["name"],
22 subtest["name"],