Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
Signed-off-by: Krasi Georgiev <[email protected]>
  • Loading branch information
krasi-georgiev committed Aug 21, 2020
1 parent db2eb42 commit fd6fa68
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions pkg/query/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (s series) Iterator() chunkenc.Iterator {

// TestQuerier_Select tests expected results with and without deduplication.
// To test with real data:
// Collect the expected results from Prometheus through "/api/v1/query_range" and save to a file.
// Collect the expected results from Prometheus or Thanos through "/api/v1/query_range" and save to a file.
// Collect raw data to be used for local storage:
// scripts/insecure_grpcurl_series.sh queriesGrpcIP:port '[{"name": "__name__", "value":"cluster_version"},{"name":"_id","value":"xxx"}]' 1597823000000 1597824600000 > localStorage.json
// Remove all white space from the file and put each series in a new line.
Expand All @@ -321,10 +321,10 @@ func TestQuerier_Select(t *testing.T) {
for _, tcase := range []struct {
name string
storeAPI storepb.StoreServer
hints *storage.SelectHints
equivalentQuery string
matchers []*labels.Matcher
replicaLabels []string // Replica label groups chunks by the label value and strips it from the final result.
hints *storage.SelectHints
equivalentQuery string

expected []series
expectedAfterDedup series
Expand Down Expand Up @@ -698,19 +698,6 @@ func (q *mockedQueryable) Close() error {
return nil
}

type mockedQuerier struct {
series []series
storage.LabelQuerier
}

func (q mockedQuerier) Select(_ bool, _ *storage.SelectHints, _ ...*labels.Matcher) storage.SeriesSet {
return &mockedSeriesSet{series: q.series}
}

func (q mockedQuerier) Close() error {
return nil
}

// TODO(bwplotka): Reuse SeriesSets from chunk iterators from Prometheus.
type mockedSeriesSet struct {
series []series
Expand Down

0 comments on commit fd6fa68

Please sign in to comment.