Skip to content

Commit

Permalink
fix: set correct number of keys in background cache metrics (grafana#…
Browse files Browse the repository at this point in the history
…2764)

Signed-off-by: Trevor Wood <Trevor.G.Wood@gmail.com>

Co-authored-by: Marco Pracucci <marco@pracucci.com>
  • Loading branch information
taharah and pracucci authored Jun 23, 2020
1 parent 12b8b2f commit 1818bdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cache/background.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ func (c *backgroundCache) Store(ctx context.Context, keys []string, bufs [][]byt
}
select {
case c.bgWrites <- bgWrite:
c.queueLength.Add(float64(len(keys)))
c.queueLength.Add(float64(num))
default:
c.droppedWriteBack.Add(float64(len(keys)))
c.droppedWriteBack.Add(float64(num))
sp := opentracing.SpanFromContext(ctx)
if sp != nil {
sp.LogFields(otlog.Int("dropped", len(keys)))
sp.LogFields(otlog.Int("dropped", num))
}
return // queue is full; give up
}
Expand Down

0 comments on commit 1818bdf

Please sign in to comment.