Skip to content

Commit

Permalink
Fix linting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn committed Mar 22, 2024
1 parent e8ace15 commit 333c8df
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/querier/engine/streaming/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ type Engine struct {
lookbackDelta time.Duration
}

func (e *Engine) NewInstantQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, ts time.Time) (promql.Query, error) {
func (e *Engine) NewInstantQuery(_ context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, ts time.Time) (promql.Query, error) {
return newQuery(q, opts, qs, ts, ts, 0, e)
}

func (e *Engine) NewRangeQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, start, end time.Time, interval time.Duration) (promql.Query, error) {
func (e *Engine) NewRangeQuery(_ context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, start, end time.Time, interval time.Duration) (promql.Query, error) {
if interval <= 0 {
return nil, fmt.Errorf("%v is not a valid interval for a range query, must be greater than 0", interval)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package operator
import (
"context"
"fmt"

"github.com/prometheus/prometheus/model/histogram"
"github.com/prometheus/prometheus/model/timestamp"
"github.com/prometheus/prometheus/model/value"
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/engine/streaming/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type InstantVectorOperator interface {
Close()
}

var EOS = errors.New("operator stream exhausted")
var EOS = errors.New("operator stream exhausted") //nolint:revive

type SeriesMetadata struct {
Labels labels.Labels
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/engine/streaming/operator/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ var (
}}

// TODO: what is a reasonable upper limit here?
floatSlicePool = pool.New(1, 100000, 10, func(size int) interface{} {
floatSlicePool = pool.New(1, 100000, 10, func(_ int) interface{} {
// Don't allocate a new slice now - we'll allocate one in GetFloatSlice if we need it, so we can differentiate between reused and new slices.
return nil
})

// TODO: what is a reasonable upper limit here?
boolSlicePool = pool.New(1, 100000, 10, func(size int) interface{} {
boolSlicePool = pool.New(1, 100000, 10, func(_ int) interface{} {
// Don't allocate a new slice now - we'll allocate one in GetBoolSlice if we need it, so we can differentiate between reused and new slices.
return nil
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package operator
import (
"context"
"fmt"

"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/model/timestamp"
"github.com/prometheus/prometheus/model/value"
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/engine/streaming/util/ring_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func (b *RingBuffer) Points() ([]promql.FPoint, []promql.FPoint) {
endOfHeadSegment := endOfTailSegment % len(b.points)
endOfTailSegment = len(b.points)
return b.points[b.firstIndex:endOfTailSegment], b.points[0:endOfHeadSegment]
} else {
return b.points[b.firstIndex:endOfTailSegment], nil
}

return b.points[b.firstIndex:endOfTailSegment], nil
}

// ForEach calls f for each point in this buffer.
Expand Down

0 comments on commit 333c8df

Please sign in to comment.