Skip to content

Commit

Permalink
Include actual logic change
Browse files Browse the repository at this point in the history
Signed-off-by: JamesMurkin <jamesmurkin@hotmail.com>
  • Loading branch information
JamesMurkin committed Aug 12, 2024
1 parent 1cca199 commit 46417da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/scheduler/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,14 @@ func (c *MetricsCollector) updateQueueMetrics(ctx *armadacontext.Context) ([]pro
continue
}
recorder = qs.queuedJobRecorder
timeInState = currentTime.Sub(time.Unix(0, job.Created()))
queuedTime := time.Unix(0, job.Created())
if job.HasRuns() {
terminationTimeOfLatestRun := job.LatestRun().TerminatedTime()
if terminationTimeOfLatestRun != nil && terminationTimeOfLatestRun.After(queuedTime) {
queuedTime = *terminationTimeOfLatestRun
}
}
timeInState = currentTime.Sub(queuedTime)
queuedJobsCount[job.Queue()]++
schedulingKeysByQueue[job.Queue()][job.SchedulingKey()] = true
} else {
Expand Down

0 comments on commit 46417da

Please sign in to comment.