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

Function TestStats_AddFetchedDataBytes

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

Source from the content-addressed store, hash-verified

100}
101
102func TestStats_AddFetchedDataBytes(t *testing.T) {
103 t.Parallel()
104 t.Run("add and load bytes", func(t *testing.T) {
105 stats, _ := ContextWithEmptyStats(context.Background())
106 stats.AddFetchedDataBytes(4096)
107 stats.AddFetchedDataBytes(4096)
108
109 assert.Equal(t, uint64(8192), stats.LoadFetchedDataBytes())
110 })
111
112 t.Run("add and load bytes nil receiver", func(t *testing.T) {
113 var stats *QueryStats
114 stats.AddFetchedDataBytes(1024)
115
116 assert.Equal(t, uint64(0), stats.LoadFetchedDataBytes())
117 })
118}
119
120func TestStats_AddFetchedChunks(t *testing.T) {
121 t.Parallel()

Callers

nothing calls this directly

Calls 5

AddFetchedDataBytesMethod · 0.95
LoadFetchedDataBytesMethod · 0.95
ContextWithEmptyStatsFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected