(ctx context.Context, minT, maxT int64, matchers []*labels.Matcher)
| 598 | } |
| 599 | |
| 600 | func (q *parquetQuerierWithFallback) getBlocks(ctx context.Context, minT, maxT int64, matchers []*labels.Matcher) ([]*bucketindex.Block, []*bucketindex.Block, error) { |
| 601 | userID, err := users.TenantID(ctx) |
| 602 | if err != nil { |
| 603 | return nil, nil, err |
| 604 | } |
| 605 | |
| 606 | maxT = q.adjustMaxT(maxT) |
| 607 | |
| 608 | if maxT < minT { |
| 609 | return nil, nil, nil |
| 610 | } |
| 611 | |
| 612 | blocks, _, err := q.finder.GetBlocks(ctx, userID, minT, maxT, matchers) |
| 613 | if err != nil { |
| 614 | return nil, nil, err |
| 615 | } |
| 616 | |
| 617 | useParquet := getBlockStoreType(ctx, q.defaultBlockStoreType) == parquetBlockStore |
| 618 | parquetBlocks := make([]*bucketindex.Block, 0, len(blocks)) |
| 619 | remaining := make([]*bucketindex.Block, 0, len(blocks)) |
| 620 | for _, b := range blocks { |
| 621 | if useParquet && b.Parquet != nil { |
| 622 | parquetBlocks = append(parquetBlocks, b) |
| 623 | continue |
| 624 | } |
| 625 | remaining = append(remaining, b) |
| 626 | } |
| 627 | |
| 628 | q.metrics.blocksQueriedTotal.WithLabelValues("parquet").Add(float64(len(parquetBlocks))) |
| 629 | q.metrics.blocksQueriedTotal.WithLabelValues("tsdb").Add(float64(len(remaining))) |
| 630 | return remaining, parquetBlocks, nil |
| 631 | } |
| 632 | |
| 633 | func (q *parquetQuerierWithFallback) incrementOpsMetric(method string, remaining []*bucketindex.Block, parquetBlocks []*bucketindex.Block) { |
| 634 | switch { |
no test coverage detected