@@ -33,13 +33,14 @@ def build_metrics_from_data_array(metrics: List[dict], labels: dict) -> List[dic
3333 return result
3434
3535
36- def build_metrics_from_target (target : dict ) -> List [dict ]:
36+ def build_metrics_from_target (target : dict , runner : str ) -> List [dict ]:
3737 result = []
3838 project = target ["target" ]
3939
4040 result .extend (build_metrics_from_data_array (
4141 target ["summarised" ],
4242 {
43+ "runner" : runner ,
4344 "project" : project
4445 }
4546 ))
@@ -49,6 +50,7 @@ def build_metrics_from_target(target: dict) -> List[dict]:
4950 result .extend (build_metrics_from_data_array (
5051 class_item ["data" ],
5152 {
53+ "runner" : runner ,
5254 "project" : project ,
5355 "class" : class_name
5456 }
@@ -57,10 +59,10 @@ def build_metrics_from_target(target: dict) -> List[dict]:
5759 return result
5860
5961
60- def build_metrics_from_targets (targets : List [dict ]) -> List [dict ]:
62+ def build_metrics_from_targets (targets : List [dict ], runner : str ) -> List [dict ]:
6163 metrics = []
6264 for target in targets :
63- metrics .extend (build_metrics_from_target (target ))
65+ metrics .extend (build_metrics_from_target (target , runner ))
6466 return metrics
6567
6668
@@ -82,7 +84,8 @@ def get_args():
8284def main ():
8385 args = get_args ()
8486 stats = load (args .stats_file )
85- metrics = build_metrics_from_targets (stats ["targets" ])
87+ runner = stats ["metadata" ]["environment" ]["host" ]
88+ metrics = build_metrics_from_targets (stats ["targets" ], runner )
8689 with open (args .output_file , "w" ) as f :
8790 json .dump (metrics , f , indent = 4 )
8891
0 commit comments