Skip to content

Commit

Permalink
Merge pull request #501 from bookingcom/grzkv/backend_time_in_q_fix
Browse files Browse the repository at this point in the history
Added conversion to seconds for the time in back-end queue durations.
  • Loading branch information
grzkv authored Jan 30, 2024
2 parents 05da347 + 8bb1a60 commit b99db6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (b *Backend) Proc() {
}
semaphore <- true
b.saturation.Inc()
b.timeInQSec.WithLabelValues(requestLabel).Observe(float64(time.Since(r.StartTime)))
b.timeInQSec.WithLabelValues(requestLabel).Observe(float64(time.Since(r.StartTime).Seconds()))
go func(req *renderReq) {
t := prometheus.NewTimer(b.backendDuration.WithLabelValues("render"))
res, err := b.BackendImpl.Render(req.Ctx, req.RenderRequest)
Expand All @@ -164,7 +164,7 @@ func (b *Backend) Proc() {
b.requestsInQueue.WithLabelValues(requestLabel).Dec()
semaphore <- true
b.saturation.Inc()
b.timeInQSec.WithLabelValues(requestLabel).Observe(float64(time.Since(r.StartTime)))
b.timeInQSec.WithLabelValues(requestLabel).Observe(float64(time.Since(r.StartTime).Seconds()))
go func(req *findReq) {
t := prometheus.NewTimer(b.backendDuration.WithLabelValues(requestLabel))
res, err := b.BackendImpl.Find(req.Ctx, req.FindRequest)
Expand Down

0 comments on commit b99db6a

Please sign in to comment.