2017-08-30 17:34:00 +03:00
|
|
|
#!/usr/bin/env python3
|
2017-08-21 19:34:54 +03:00
|
|
|
|
2020-12-14 20:50:17 +03:00
|
|
|
from __future__ import absolute_import, division, print_function
|
2018-12-31 19:51:03 +03:00
|
|
|
import sys
|
|
|
|
import subprocess
|
|
|
|
import json
|
|
|
|
import statistics
|
2017-08-21 19:34:54 +03:00
|
|
|
|
|
|
|
proc = subprocess.Popen(["./mach", "gtest", sys.argv[1]], stdout=subprocess.PIPE)
|
|
|
|
for line in proc.stdout:
|
|
|
|
if line.startswith(b"PERFHERDER_DATA:"):
|
|
|
|
data = json.loads(line[len("PERFHERDER_DATA:") :].decode("utf8"))
|
|
|
|
for suite in data["suites"]:
|
|
|
|
for subtest in suite["subtests"]:
|
2020-12-11 19:05:25 +03:00
|
|
|
# pylint --py3k W1619
|
2017-08-21 19:34:54 +03:00
|
|
|
print(
|
|
|
|
"%4d.%03d ± %6s ms %s.%s"
|
|
|
|
% (
|
|
|
|
subtest["value"] / 1000.0,
|
|
|
|
subtest["value"] % 1000,
|
|
|
|
"%.3f" % (statistics.stdev(subtest["replicates"]) / 1000),
|
|
|
|
suite["name"],
|
|
|
|
subtest["name"],
|
2020-10-26 21:34:53 +03:00
|
|
|
)
|
2017-08-21 19:34:54 +03:00
|
|
|
)
|