MCPcopy
hub / github.com/prometheus/prometheus / TestBlockBaseSeriesSet

Function TestBlockBaseSeriesSet

tsdb/querier_test.go:3627–3726  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3625}
3626
3627func TestBlockBaseSeriesSet(t *testing.T) {
3628 type refdSeries struct {
3629 lset labels.Labels
3630 chunks []chunks.Meta
3631
3632 ref storage.SeriesRef
3633 }
3634
3635 cases := []struct {
3636 series []refdSeries
3637 // Postings should be in the sorted order of the series
3638 postings []storage.SeriesRef
3639
3640 expIdxs []int
3641 }{
3642 {
3643 series: []refdSeries{
3644 {
3645 lset: labels.FromStrings("a", "a"),
3646 chunks: []chunks.Meta{
3647 {Ref: 29},
3648 {Ref: 45},
3649 {Ref: 245},
3650 {Ref: 123},
3651 {Ref: 4232},
3652 {Ref: 5344},
3653 {Ref: 121},
3654 },
3655 ref: 12,
3656 },
3657 {
3658 lset: labels.FromStrings("a", "a", "b", "b"),
3659 chunks: []chunks.Meta{
3660 {Ref: 82}, {Ref: 23}, {Ref: 234}, {Ref: 65}, {Ref: 26},
3661 },
3662 ref: 10,
3663 },
3664 {
3665 lset: labels.FromStrings("b", "c"),
3666 chunks: []chunks.Meta{{Ref: 8282}},
3667 ref: 1,
3668 },
3669 {
3670 lset: labels.FromStrings("b", "b"),
3671 chunks: []chunks.Meta{
3672 {Ref: 829}, {Ref: 239}, {Ref: 2349}, {Ref: 659}, {Ref: 269},
3673 },
3674 ref: 108,
3675 },
3676 },
3677 postings: []storage.SeriesRef{12, 13, 10, 108}, // 13 doesn't exist and should just be skipped over.
3678 expIdxs: []int{0, 1, 3},
3679 },
3680 {
3681 series: []refdSeries{
3682 {
3683 lset: labels.FromStrings("a", "a", "b", "b"),
3684 chunks: []chunks.Meta{

Callers

nothing calls this directly

Calls 9

NextMethod · 0.95
resetMethod · 0.95
ErrMethod · 0.95
FromStringsFunction · 0.92
NewListPostingsFunction · 0.92
NewMemTombstonesFunction · 0.92
newMockIndexFunction · 0.70
AddSeriesMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…