(ctx context.Context, from, to model.Time, partialDataEnabled bool, matchers ...*labels.Matcher)
| 69 | } |
| 70 | |
| 71 | func (m *MockLimitingDistributor) QueryStream(ctx context.Context, from, to model.Time, partialDataEnabled bool, matchers ...*labels.Matcher) (*client.QueryStreamResponse, error) { |
| 72 | var ( |
| 73 | queryLimiter = limiter.QueryLimiterFromContextWithFallback(ctx) |
| 74 | ) |
| 75 | s := make([][]cortexpb.LabelAdapter, 0, len(m.response.Chunkseries)) |
| 76 | |
| 77 | response := &client.QueryStreamResponse{} |
| 78 | for _, series := range m.response.Chunkseries { |
| 79 | for _, label := range series.Labels { |
| 80 | for _, matcher := range matchers { |
| 81 | if matcher.Matches(label.Value) { |
| 82 | s = append(s, series.Labels) |
| 83 | response.Chunkseries = append(response.Chunkseries, series) |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | if limitErr := queryLimiter.AddSeries(s...); limitErr != nil { |
| 90 | return nil, validation.LimitError(limitErr.Error()) |
| 91 | } |
| 92 | return response, nil |
| 93 | } |
| 94 | |
| 95 | type TestConfig struct { |
| 96 | Cfg Config |
nothing calls this directly
no test coverage detected