working commit

This commit is contained in:
Thomas Jackson 2021-01-14 22:20:10 -08:00 committed by Rishabh Kumar
parent 07f178a4be
commit fbeaec447f

View file

@ -198,11 +198,12 @@ type VectorSelector struct {
// Offset is the offset used during the query execution
// which is calculated using the original offset, at modifier time,
// eval time, and subquery offsets in the AST tree.
SkipHistogramBuckets bool // Set when decoding native histogram buckets is not needed for query evaluation.
Offset time.Duration
Timestamp *int64
SkipHistogramBuckets bool // Set when decoding native histogram buckets is not needed for query evaluation.
StartOrEnd ItemType // Set when @ is used with start() or end()
LabelMatchers []*labels.Matcher
LookbackDelta time.Duration
// The unexpanded seriesSet populated at query preparation time.
UnexpandedSeriesSet storage.SeriesSet
@ -215,6 +216,14 @@ type VectorSelector struct {
PosRange posrange.PositionRange
}
func (m *VectorSelector) GetLookbackDelta(d time.Duration) time.Duration {
if m.LookbackDelta > 0 {
return m.LookbackDelta
}
return d
}
// TestStmt is an internal helper statement that allows execution
// of an arbitrary function during handling. It is used to test the Engine.
type TestStmt func(context.Context) error