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

Function TestStats_AddFetchedChunkBytes

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

Source from the content-addressed store, hash-verified

82}
83
84func TestStats_AddFetchedChunkBytes(t *testing.T) {
85 t.Parallel()
86 t.Run("add and load bytes", func(t *testing.T) {
87 stats, _ := ContextWithEmptyStats(context.Background())
88 stats.AddFetchedChunkBytes(4096)
89 stats.AddFetchedChunkBytes(4096)
90
91 assert.Equal(t, uint64(8192), stats.LoadFetchedChunkBytes())
92 })
93
94 t.Run("add and load bytes nil receiver", func(t *testing.T) {
95 var stats *QueryStats
96 stats.AddFetchedChunkBytes(1024)
97
98 assert.Equal(t, uint64(0), stats.LoadFetchedChunkBytes())
99 })
100}
101
102func TestStats_AddFetchedDataBytes(t *testing.T) {
103 t.Parallel()

Callers

nothing calls this directly

Calls 5

AddFetchedChunkBytesMethod · 0.95
LoadFetchedChunkBytesMethod · 0.95
ContextWithEmptyStatsFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected