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

Function getPostingForLabels

pkg/ingester/user_state.go:193–204  ·  view source on GitHub ↗
(ctx context.Context, ir tsdb.IndexReader, lbls labels.Labels)

Source from the content-addressed store, hash-verified

191}
192
193func getPostingForLabels(ctx context.Context, ir tsdb.IndexReader, lbls labels.Labels) (index.Postings, error) {
194 postings := make([]index.Postings, 0, lbls.Len())
195 for name, value := range lbls.Map() {
196 p, err := ir.Postings(ctx, name, value)
197 if err != nil {
198 return nil, err
199 }
200 postings = append(postings, p)
201 }
202
203 return index.Intersect(postings...), nil
204}
205
206func getPostingCardinality(p index.Postings) (int, error) {
207 totalCount := 0

Callers 2

TestGetPostingForLabelsFunction · 0.85

Calls 2

PostingsMethod · 0.80
LenMethod · 0.45

Tested by 1

TestGetPostingForLabelsFunction · 0.68