mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
Fix matrix interval time calculation.
This commit is contained in:
parent
fdf9a3aab7
commit
c52b959fda
|
@ -110,11 +110,10 @@ func NewMatrix(vector ast.Node, intervalStr string) (ast.MatrixNode, error) {
|
|||
default:
|
||||
return nil, rulesError("Intervals are currently only supported for vector literals.")
|
||||
}
|
||||
duration, err := stringToDuration(intervalStr)
|
||||
interval, err := stringToDuration(intervalStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
interval := time.Duration(duration) * time.Second
|
||||
vectorLiteral := vector.(*ast.VectorLiteral)
|
||||
return ast.NewMatrixLiteral(vectorLiteral, interval), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue