-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize index cache metrics (#6523)
- Loading branch information
Showing
10 changed files
with
114 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) The Thanos Authors. | ||
// Licensed under the Apache License 2.0. | ||
|
||
package storecache | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/efficientgo/core/testutil" | ||
"github.com/go-kit/log" | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
func TestIndexCacheMetrics(t *testing.T) { | ||
reg := prometheus.NewRegistry() | ||
commonMetrics := newCommonMetrics(reg) | ||
|
||
memcached := newMockedMemcachedClient(nil) | ||
_, err := NewRemoteIndexCache(log.NewNopLogger(), memcached, commonMetrics, reg) | ||
testutil.Ok(t, err) | ||
conf := []byte(` | ||
max_size: 10MB | ||
max_item_size: 1MB | ||
`) | ||
// Make sure that the in memory cache does not register the same metrics of the remote index cache. | ||
// If so, we should move those metrics to the `commonMetrics` | ||
_, err = NewInMemoryIndexCache(log.NewNopLogger(), commonMetrics, reg, conf) | ||
testutil.Ok(t, err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.