Skip to content

Commit

Permalink
Use counter for transcoded segments
Browse files Browse the repository at this point in the history
  • Loading branch information
red-0ne committed Dec 16, 2022
1 parent 961b3b3 commit e27242c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type VODPipelineMetrics struct {
Count *prometheus.CounterVec
Duration *prometheus.SummaryVec
SourceSegments *prometheus.SummaryVec
TranscodedSegments *prometheus.SummaryVec
TranscodedSegments *prometheus.CounterVec
SourceBytes *prometheus.SummaryVec
SourceDuration *prometheus.SummaryVec
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func NewMetrics() *CatalystAPIMetrics {
Name: "vod_source_segments",
Help: "Number of segments of the source asset",
}, vodLabels),
TranscodedSegments: promauto.NewSummaryVec(prometheus.SummaryOpts{
TranscodedSegments: promauto.NewCounterVec(prometheus.CounterOpts{
Name: "vod_transcoded_segments",
Help: "Number of segments of rendition asset",
}, vodLabels),
Expand Down
2 changes: 1 addition & 1 deletion pipeline/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func (c *Coordinator) finishJob(job *JobInfo, out *HandlerOutput, err error) {

metrics.Metrics.VODPipelineMetrics.TranscodedSegments.
WithLabelValues(labels...).
Observe(float64(job.transcodedSegments))
Add(float64(job.transcodedSegments))

job.result <- success
}
Expand Down

0 comments on commit e27242c

Please sign in to comment.