Skip to content

Commit f589d52

Browse files
committed
Make reviewer requested changes.
1 parent 3723737 commit f589d52

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

.ci/metrics/metrics.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def _construct_aggregate(ag_name: str, job_list: list[JobMetrics]) -> AggregateM
112112
113113
Args:
114114
ag_name: The name for this particular AggregateMetric
115-
116115
job_list: This list of JobMetrics to be combined into the AggregateMetric.
117116
The input list should contain all (and only!) the libc++ JobMetrics
118117
for a particular stage and a particular workflow_id.
@@ -131,30 +130,28 @@ def _construct_aggregate(ag_name: str, job_list: list[JobMetrics]) -> AggregateM
131130
ag_workflow_id = job_list[0].workflow_id
132131

133132
# Go through rest of jobs for this workflow id, if any, updating stats
134-
if len(job_list) > 1:
135-
for job in job_list[1:]:
136-
# Update the status
137-
ag_status = ag_status and job.status
138-
# Get the earliest & latest times
139-
if job.created_at_ns < earliest_create:
140-
earliest_create = job.created_at_ns
141-
if job.completed_at_ns < earliest_complete:
142-
earliest_complete = job.completed_at_ns
143-
if job.started_at_ns > latest_start:
144-
latest_start = job.started_at_ns
145-
if job.started_at_ns < earliest_start:
146-
earliest_start = job.started_at_ns
147-
if job.completed_at_ns > latest_complete:
148-
latest_complete = job.completed_at_ns
133+
for job in job_list[1:]:
134+
# Update the status
135+
ag_status = ag_status and job.status
136+
# Get the earliest & latest times
137+
if job.created_at_ns < earliest_create:
138+
earliest_create = job.created_at_ns
139+
if job.completed_at_ns < earliest_complete:
140+
earliest_complete = job.completed_at_ns
141+
if job.started_at_ns > latest_start:
142+
latest_start = job.started_at_ns
143+
if job.started_at_ns < earliest_start:
144+
earliest_start = job.started_at_ns
145+
if job.completed_at_ns > latest_complete:
146+
latest_complete = job.completed_at_ns
149147

150148
# Compute aggregate run time (in seconds, not ns)
151149
ag_run_time = (latest_complete - earliest_start) / 1000000000
152150
# Compute aggregate queue time (in seconds, not ns)
153151
ag_queue_time = (latest_start - earliest_create) / 1000000000
154152
# Append the aggregate metrics to the workflow metrics list.
155-
aggregate = AggregateMetric(ag_name, ag_queue_time, ag_run_time, ag_status,
156-
latest_complete, ag_workflow_id)
157-
return aggregate
153+
return AggregateMetric(ag_name, ag_queue_time, ag_run_time, ag_status,
154+
latest_complete, ag_workflow_id)
158155

159156
def create_and_append_libcxx_aggregates(workflow_metrics: list[JobMetrics]):
160157
"""Find libc++ JobMetric entries and create aggregate metrics for them.
@@ -302,7 +299,7 @@ def github_get_metrics(
302299
break
303300

304301
# This workflow is not interesting to us.
305-
if (task.name not in GITHUB_WORKFLOW_TO_TRACK):
302+
if task.name not in GITHUB_WORKFLOW_TO_TRACK:
306303
continue
307304

308305
libcxx_testing = False

0 commit comments

Comments
 (0)