MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestIngester_MaxExemplarsFallBack

Function TestIngester_MaxExemplarsFallBack

pkg/ingester/ingester_test.go:6879–6902  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6877}
6878
6879func TestIngester_MaxExemplarsFallBack(t *testing.T) {
6880 // Create ingester.
6881 cfg := defaultIngesterTestConfig(t)
6882 cfg.BlocksStorageConfig.TSDB.MaxExemplars = 2
6883
6884 dir := t.TempDir()
6885 blocksDir := filepath.Join(dir, "blocks")
6886 limits := defaultLimitsTestConfig()
6887 limits.EnableNativeHistograms = true
6888 i, err := prepareIngesterWithBlocksStorageAndLimits(t, cfg, limits, nil, blocksDir, prometheus.NewRegistry())
6889 require.NoError(t, err)
6890
6891 maxExemplars := i.getMaxExemplars("someTenant")
6892 require.Equal(t, maxExemplars, int64(2))
6893
6894 // set max exemplars value in limits, and re-initialize the ingester
6895 limits.MaxExemplars = 5
6896 i, err = prepareIngesterWithBlocksStorageAndLimits(t, cfg, limits, nil, blocksDir, prometheus.NewRegistry())
6897 require.NoError(t, err)
6898
6899 // validate this value is picked up now
6900 maxExemplars = i.getMaxExemplars("someTenant")
6901 require.Equal(t, maxExemplars, int64(5))
6902}
6903
6904func Test_Ingester_QueryExemplar_MaxInflightQueryRequest(t *testing.T) {
6905 cfg := defaultIngesterTestConfig(t)

Callers

nothing calls this directly

Calls 6

defaultLimitsTestConfigFunction · 0.85
JoinMethod · 0.80
getMaxExemplarsMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected