Skip to content

Commit 4ec594a

Browse files
committed
fix reporting of unit for pyperformance
1 parent b74f74c commit 4ec594a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ def parse(self, text: str) -> dict:
3131
js = json.load(fp)
3232
benchmarks = js["benchmarks"]
3333
for benchmark in benchmarks:
34-
unit = {
35-
"second": "s",
36-
"millisecond": "ms",
37-
}.get(unit := js["metadata"]["unit"], unit)
3834
name = benchmark.get("metadata", js["metadata"])["name"]
3935
for run in benchmark["runs"]:
4036
if values := run.get("values", None):
@@ -45,7 +41,7 @@ def parse(self, text: str) -> dict:
4541
"bench-suite": self.suiteName,
4642
"benchmark": name,
4743
"metric.name": "warmup",
48-
"metric.unit": unit,
44+
"metric.unit": "ms",
4945
"metric.score-function": "id",
5046
"metric.better": "lower",
5147
"metric.type": "numeric",
@@ -59,7 +55,7 @@ def parse(self, text: str) -> dict:
5955
"bench-suite": self.suiteName,
6056
"benchmark": name,
6157
"metric.name": "time",
62-
"metric.unit": unit,
58+
"metric.unit": "ms",
6359
"metric.score-function": "id",
6460
"metric.better": "lower",
6561
"metric.type": "numeric",
@@ -75,7 +71,7 @@ def parse(self, text: str) -> dict:
7571
"bench-suite": self.suiteName,
7672
"benchmark": name,
7773
"metric.name": "max-rss",
78-
"metric.unit": unit,
74+
"metric.unit": "B",
7975
"metric.score-function": "id",
8076
"metric.better": "lower",
8177
"metric.type": "numeric",

0 commit comments

Comments
 (0)