mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 22:37:27 -08:00
Fixed float conversion difference.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This commit is contained in:
parent
cfba92a133
commit
ad51c649b5
|
@ -2713,13 +2713,13 @@ func TestTimeMetrics(t *testing.T) {
|
||||||
|
|
||||||
// Check initial values.
|
// Check initial values.
|
||||||
testutil.Ok(t, db.metrics.minTime.Write(metrics))
|
testutil.Ok(t, db.metrics.minTime.Write(metrics))
|
||||||
testutil.Equals(t, float64(model.Latest)/1000, metrics.Gauge.GetValue())
|
testutil.Equals(t, float64(math.MaxInt64)/1000, metrics.Gauge.GetValue())
|
||||||
|
|
||||||
testutil.Ok(t, db.metrics.headMinTime.Write(metrics))
|
testutil.Ok(t, db.metrics.headMinTime.Write(metrics))
|
||||||
testutil.Equals(t, float64(model.Latest)/1000, metrics.Gauge.GetValue())
|
testutil.Equals(t, float64(math.MaxInt64)/1000, metrics.Gauge.GetValue())
|
||||||
|
|
||||||
testutil.Ok(t, db.metrics.headMaxTime.Write(metrics))
|
testutil.Ok(t, db.metrics.headMaxTime.Write(metrics))
|
||||||
testutil.Equals(t, float64(model.Earliest)/1000, metrics.Gauge.GetValue())
|
testutil.Equals(t, float64(math.MinInt64)/1000, metrics.Gauge.GetValue())
|
||||||
|
|
||||||
app := db.Appender()
|
app := db.Appender()
|
||||||
|
|
||||||
|
@ -2730,12 +2730,12 @@ func TestTimeMetrics(t *testing.T) {
|
||||||
|
|
||||||
// Check after adding some samples.
|
// Check after adding some samples.
|
||||||
testutil.Ok(t, db.metrics.minTime.Write(metrics))
|
testutil.Ok(t, db.metrics.minTime.Write(metrics))
|
||||||
testutil.Equals(t, 0.001, metrics.Gauge.GetValue())
|
testutil.Equals(t, 0.0, metrics.Gauge.GetValue())
|
||||||
|
|
||||||
testutil.Ok(t, db.metrics.headMinTime.Write(metrics))
|
testutil.Ok(t, db.metrics.headMinTime.Write(metrics))
|
||||||
testutil.Equals(t, 0.001, metrics.Gauge.GetValue())
|
testutil.Equals(t, 0.0, metrics.Gauge.GetValue())
|
||||||
|
|
||||||
testutil.Ok(t, db.metrics.headMaxTime.Write(metrics))
|
testutil.Ok(t, db.metrics.headMaxTime.Write(metrics))
|
||||||
testutil.Equals(t, 0.003, metrics.Gauge.GetValue())
|
testutil.Equals(t, 0.0, metrics.Gauge.GetValue())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue