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

Function TestStats_AddFetchedChunks

pkg/querier/stats/stats_test.go:120–136  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

118}
119
120func TestStats_AddFetchedChunks(t *testing.T) {
121 t.Parallel()
122 t.Run("add and load chunks", func(t *testing.T) {
123 stats, _ := ContextWithEmptyStats(context.Background())
124 stats.AddFetchedChunks(4096)
125 stats.AddFetchedChunks(4096)
126
127 assert.Equal(t, uint64(8192), stats.LoadFetchedChunks())
128 })
129
130 t.Run("add and load chunks nil receiver", func(t *testing.T) {
131 var stats *QueryStats
132 stats.AddFetchedChunks(1024)
133
134 assert.Equal(t, uint64(0), stats.LoadFetchedChunks())
135 })
136}
137
138func TestStats_AddFetchedSamples(t *testing.T) {
139 t.Parallel()

Callers

nothing calls this directly

Calls 5

AddFetchedChunksMethod · 0.95
LoadFetchedChunksMethod · 0.95
ContextWithEmptyStatsFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected