mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
time() return milliseconds (#3811)
This commit is contained in:
parent
404b306fb9
commit
4801573b64
|
@ -38,7 +38,7 @@ type Function struct {
|
|||
// === time() float64 ===
|
||||
func funcTime(ev *evaluator, args Expressions) Value {
|
||||
return Scalar{
|
||||
V: float64(ev.Timestamp / 1000),
|
||||
V: float64(ev.Timestamp) / 1000,
|
||||
T: ev.Timestamp,
|
||||
}
|
||||
}
|
||||
|
|
3
promql/testdata/functions.test
vendored
3
promql/testdata/functions.test
vendored
|
@ -434,6 +434,9 @@ clear
|
|||
eval instant at 0m year()
|
||||
{} 1970
|
||||
|
||||
eval instant at 1ms time()
|
||||
0.001
|
||||
|
||||
eval instant at 0m year(vector(1136239445))
|
||||
{} 2006
|
||||
|
||||
|
|
Loading…
Reference in a new issue