4 from headwind.spec
import CollectorResult, Run, Metric
8 assert len(sys.argv) == 2
9 input_file = sys.argv[1]
15 df = pd.read_csv(input_file)
16 df = df.drop_duplicates(subset=[
"file"])
17 df.max_rss = df.max_rss / 1024 / 1024 / 1024
21 mdf = df.sort_values(by=
"max_rss", ascending=
False)
22 for row
in mdf.itertuples():
23 name =
"max_rss_" + row.file
25 Metric(name=name, value=row.max_rss, unit=
"GB", group=
"compile_max_rss")
27 if name
in metric_names:
28 print(
"Duplicate:", name)
29 metric_names.append(name)
31 tdf = df.sort_values(by=
"time", ascending=
False)
32 for row
in tdf.itertuples():
33 name =
"time_" + row.file
35 Metric(name=name, value=row.time, unit=
"seconds", group=
"compile_time")
37 if name
in metric_names:
38 print(
"Duplicate:", name)
39 metric_names.append(name)
41 sys.stdout.write(CollectorResult(metrics=metrics).json(indent=2))