From 6c06810ec2c592ee27dd2bfa00e47cd3bce370a6 Mon Sep 17 00:00:00 2001 From: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com> Date: Tue, 11 Aug 2020 02:05:33 +0300 Subject: [PATCH] remove hints from series Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com> --- pkg/api/query/v1.go | 17 +---------------- pkg/query/iter.go | 4 ++-- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index 0a42d2d3a15..7cc30675b28 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -486,15 +486,6 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} } - var step time.Duration - if t := r.FormValue("step"); t != "" { - var err error - step, err = parseDuration(t) - if err != nil { - return nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err} - } - } - var matcherSets [][]*labels.Matcher for _, s := range r.Form["match[]"] { matchers, err := parser.ParseMetricSelector(s) @@ -535,14 +526,8 @@ func (qapi *QueryAPI) series(r *http.Request) (interface{}, []error, *api.ApiErr metrics = []labels.Labels{} sets []storage.SeriesSet ) - - hints := &storage.SelectHints{ - Start: timestamp.FromTime(start), - End: timestamp.FromTime(end), - Step: int64(step), - } for _, mset := range matcherSets { - sets = append(sets, q.Select(false, hints, mset...)) + sets = append(sets, q.Select(false, nil, mset...)) } set := storage.NewMergeSeriesSet(sets, storage.ChainedSeriesMerge) diff --git a/pkg/query/iter.go b/pkg/query/iter.go index f149e2ff940..8a196a41153 100644 --- a/pkg/query/iter.go +++ b/pkg/query/iter.go @@ -30,8 +30,6 @@ type promSeriesSet struct { currChunks []storepb.AggrChunk warns storage.Warnings - - hints *storage.SelectHints } func (s *promSeriesSet) Next() bool { @@ -557,6 +555,8 @@ type dedupSeriesIterator struct { hints *storage.SelectHints } +// newDedupSeriesIterator iterates deduplicates samples from a pair or replicas. +// On each successful `replicaA.Next()`` call, `replicaB` is advanced by `hints.Step`. func newDedupSeriesIterator(a, b adjustableSeriesIterator, hints *storage.SelectHints) *dedupSeriesIterator { return &dedupSeriesIterator{ a: a,