MCPcopy
hub / github.com/prometheus/prometheus / TestSampleRingFloatST

Function TestSampleRingFloatST

storage/buffer_test.go:92–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestSampleRingFloatST(t *testing.T) {
93 r := newSampleRing(10, 5, chunkenc.ValNone)
94 require.Empty(t, r.fBuf)
95 require.Empty(t, r.hBuf)
96 require.Empty(t, r.fhBuf)
97 require.Empty(t, r.iBuf)
98
99 r.addF(fSample{st: 100, t: 11, f: 3.14})
100 it := r.iterator()
101
102 require.Equal(t, chunkenc.ValFloat, it.Next())
103 ts, f := it.At()
104 require.Equal(t, int64(11), ts)
105 require.Equal(t, 3.14, f)
106 require.Equal(t, int64(100), it.AtST())
107 require.Equal(t, chunkenc.ValNone, it.Next())
108}
109
110func TestSampleRingMixed(t *testing.T) {
111 h1 := tsdbutil.GenerateTestHistogram(1)

Callers

nothing calls this directly

Calls 6

newSampleRingFunction · 0.85
addFMethod · 0.80
NextMethod · 0.65
AtMethod · 0.65
AtSTMethod · 0.65
iteratorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…