From c4a23585510dd1a20766c36158bee9a23001fdc7 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Fri, 11 Jan 2013 01:08:47 +0100 Subject: [PATCH] Set correct interval in MatrixLiteral.Eval(). --- rules/ast/ast.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rules/ast/ast.go b/rules/ast/ast.go index 3da40c15c..2e52aa404 100644 --- a/rules/ast/ast.go +++ b/rules/ast/ast.go @@ -458,7 +458,11 @@ func (node *VectorArithExpr) Eval(timestamp *time.Time) Vector { } func (node *MatrixLiteral) Eval(timestamp *time.Time) Matrix { - values, err := persistence.GetRangeValues(node.labels, &model.Interval{}, &stalenessPolicy) + interval := &model.Interval{ + OldestInclusive: timestamp.Add(-node.interval), + NewestInclusive: *timestamp, + } + values, err := persistence.GetRangeValues(node.labels, interval, &stalenessPolicy) if err != nil { log.Printf("Unable to get values for vector interval") return Matrix{}