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

Function TestStats_AddFetchedSamples

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

Source from the content-addressed store, hash-verified

136}
137
138func TestStats_AddFetchedSamples(t *testing.T) {
139 t.Parallel()
140 t.Run("add and load samples", func(t *testing.T) {
141 stats, _ := ContextWithEmptyStats(context.Background())
142 stats.AddFetchedSamples(4096)
143 stats.AddFetchedSamples(4096)
144
145 assert.Equal(t, uint64(8192), stats.LoadFetchedSamples())
146 })
147
148 t.Run("add and load samples nil receiver", func(t *testing.T) {
149 var stats *QueryStats
150 stats.AddFetchedSamples(1024)
151
152 assert.Equal(t, uint64(0), stats.LoadFetchedSamples())
153 })
154}
155
156func TestStats_AddStoreGatewayTouchedPostings(t *testing.T) {
157 t.Parallel()

Callers

nothing calls this directly

Calls 5

AddFetchedSamplesMethod · 0.95
LoadFetchedSamplesMethod · 0.95
ContextWithEmptyStatsFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected