Skip to content

Commit

Permalink
fix index fetch latency metric timer (#6758)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 authored Oct 1, 2023
1 parent 0a4ec25 commit 531cdb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/store/cache/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (c *RemoteIndexCache) StoreExpandedPostings(blockID ulid.ULID, keys []*labe
// and returns a map containing cache hits, along with a list of missing keys.
// In case of error, it logs and return an empty cache hits map.
func (c *RemoteIndexCache) FetchExpandedPostings(ctx context.Context, blockID ulid.ULID, lbls []*labels.Matcher) ([]byte, bool) {
timer := prometheus.NewTimer(c.postingsFetchDuration)
timer := prometheus.NewTimer(c.expandedPostingsFetchDuration)
defer timer.ObserveDuration()

key := cacheKey{blockID.String(), cacheKeyExpandedPostings(labelMatchersToString(lbls)), c.compressionScheme}.string()
Expand Down Expand Up @@ -182,7 +182,7 @@ func (c *RemoteIndexCache) StoreSeries(blockID ulid.ULID, id storage.SeriesRef,
// and returns a map containing cache hits, along with a list of missing IDs.
// In case of error, it logs and return an empty cache hits map.
func (c *RemoteIndexCache) FetchMultiSeries(ctx context.Context, blockID ulid.ULID, ids []storage.SeriesRef) (hits map[storage.SeriesRef][]byte, misses []storage.SeriesRef) {
timer := prometheus.NewTimer(c.postingsFetchDuration)
timer := prometheus.NewTimer(c.seriesFetchDuration)
defer timer.ObserveDuration()

keys := make([]string, 0, len(ids))
Expand Down

0 comments on commit 531cdb1

Please sign in to comment.