Skip to content

Commit

Permalink
Pass job info by value to fix metrics for fallback jobs
Browse files Browse the repository at this point in the history
Since we're re-using the job object now we need to pass by value here to avoid picking up values from the fallback job
  • Loading branch information
mjh1 committed Sep 8, 2023
1 parent a363ab6 commit 731b460
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pipeline/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func (c *Coordinator) finishJob(job *JobInfo, out *HandlerOutput, err error) {
WithLabelValues(labels...).
Add(float64(job.transcodedSegments))

go c.sendDBMetrics(job, out)
go c.sendDBMetrics(*job, getProfileCount(out))

job.result <- success
}
Expand All @@ -568,7 +568,7 @@ func getProfileCount(out *HandlerOutput) int {
return len(out.Result.Outputs[0].Videos)
}

func (c *Coordinator) sendDBMetrics(job *JobInfo, out *HandlerOutput) {
func (c *Coordinator) sendDBMetrics(job JobInfo, profileCount int) {
if c.MetricsDB == nil {
return
}
Expand Down Expand Up @@ -618,7 +618,7 @@ func (c *Coordinator) sendDBMetrics(job *JobInfo, out *HandlerOutput) {
job.pipeline,
job.catalystRegion,
job.state,
getProfileCount(out),
profileCount,
time.Since(job.startTime).Milliseconds(),
job.sourceSegments,
job.transcodedSegments,
Expand Down

0 comments on commit 731b460

Please sign in to comment.