Skip to content

Commit

Permalink
remove hints from series
Browse files Browse the repository at this point in the history
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
  • Loading branch information
krasi-georgiev committed Aug 10, 2020
1 parent 2c6d15d commit 6c06810
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
17 changes: 1 addition & 16 deletions pkg/api/query/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/query/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ type promSeriesSet struct {
currChunks []storepb.AggrChunk

warns storage.Warnings

hints *storage.SelectHints
}

func (s *promSeriesSet) Next() bool {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6c06810

Please sign in to comment.