mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-09-30 06:11:37 +02:00
Fix job execution duration when runner assign time is not set (#4472)
This commit is contained in:
@@ -493,11 +493,13 @@ func (e *exporter) RecordJobStarted(msg *scaleset.JobStarted) {
|
||||
}
|
||||
|
||||
func (e *exporter) RecordJobCompleted(msg *scaleset.JobCompleted) {
|
||||
if msg.RunnerAssignTime.IsZero() {
|
||||
return
|
||||
}
|
||||
|
||||
l := e.completedJobLabels(msg)
|
||||
e.incCounter(MetricCompletedJobsTotal, l)
|
||||
|
||||
executionDuration := msg.FinishTime.Unix() - msg.RunnerAssignTime.Unix()
|
||||
e.observeHistogram(MetricJobExecutionDurationSeconds, l, float64(executionDuration))
|
||||
e.observeHistogram(MetricJobExecutionDurationSeconds, l, float64(msg.FinishTime.Unix()-msg.RunnerAssignTime.Unix()))
|
||||
}
|
||||
|
||||
func (e *exporter) RecordDesiredRunners(count int) {
|
||||
|
||||
Reference in New Issue
Block a user