Skip to content

Commit

Permalink
store/cache: do not forget to increase c.current on adding new items
Browse files Browse the repository at this point in the history
  • Loading branch information
Giedrius Statkevičius committed Feb 27, 2019
1 parent a14cc0d commit 8d54a99
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/store/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func (c *indexCache) setPostings(b ulid.ULID, l labels.Label, v []byte) {
c.lru.Add(cacheItem{b, cacheKeyPostings(l)}, cv)

c.currentSize.WithLabelValues(cacheTypePostings).Add(float64(len(v)))
c.current.WithLabelValues(cacheTypePostings).Inc()
}

func (c *indexCache) postings(b ulid.ULID, l labels.Label) ([]byte, bool) {
Expand Down Expand Up @@ -185,6 +186,7 @@ func (c *indexCache) setSeries(b ulid.ULID, id uint64, v []byte) {
c.lru.Add(cacheItem{b, cacheKeySeries(id)}, cv)

c.currentSize.WithLabelValues(cacheTypeSeries).Add(float64(len(v)))
c.current.WithLabelValues(cacheTypeSeries).Inc()
}

func (c *indexCache) series(b ulid.ULID, id uint64) ([]byte, bool) {
Expand Down

0 comments on commit 8d54a99

Please sign in to comment.