MCPcopy
hub / github.com/prometheus/prometheus / TestMockSeriesWithST

Function TestMockSeriesWithST

storage/interface_test.go:39–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestMockSeriesWithST(t *testing.T) {
40 s := storage.MockSeries([]int64{0, 1, 2}, []int64{1, 2, 3}, []float64{1, 2, 3}, []string{"__name__", "foo"})
41 it := s.Iterator(nil)
42 ts := []int64{}
43 vs := []float64{}
44 st := []int64{}
45 for it.Next() == chunkenc.ValFloat {
46 t, v := it.At()
47 ts = append(ts, t)
48 vs = append(vs, v)
49 st = append(st, it.AtST())
50 }
51 require.Equal(t, []int64{1, 2, 3}, ts)
52 require.Equal(t, []float64{1, 2, 3}, vs)
53 require.Equal(t, []int64{0, 1, 2}, st)
54}

Callers

nothing calls this directly

Calls 5

MockSeriesFunction · 0.92
IteratorMethod · 0.65
NextMethod · 0.65
AtMethod · 0.65
AtSTMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…