Skip to content

Commit ce4c909

Browse files
committed
add runner label
1 parent 1dd1814 commit ce4c909

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/collect-statistics.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
default: '1'
1010
type: string
1111
run_number:
12-
description: 'Number of run tries per runner'
12+
description: 'Number of run tries per runner (values greater than 1 are not supported with grafana)'
1313
required: false
1414
default: '1'
1515
type: string
@@ -37,7 +37,7 @@ on:
3737
default: '1'
3838
type: string
3939
run_number:
40-
description: 'Number of run tries per runner'
40+
description: 'Number of run tries per runner (values greater than 1 are not supported with grafana)'
4141
required: false
4242
default: '1'
4343
type: string

monitoring/prepare_metrics.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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():
8284
def 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

Comments
 (0)