mirror of https://github.com/prometheus/prometheus
parent
c7c4a5c347
commit
87eab0aaad
|
@ -838,7 +838,7 @@ func (ev *evalCmd) compareResult(result parser.Value) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// compareNativeHistogram is helper function to compare two native histograms
|
// compareNativeHistogram is helper function to compare two native histograms
|
||||||
// which can tolerate some differ in the field of float type, such as Count, Sum
|
// which can tolerate some differ in the field of float type, such as Count, Sum.
|
||||||
func compareNativeHistogram(exp, cur *histogram.FloatHistogram) bool {
|
func compareNativeHistogram(exp, cur *histogram.FloatHistogram) bool {
|
||||||
if exp == nil || cur == nil {
|
if exp == nil || cur == nil {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -25,7 +25,7 @@ var minNormal = math.Float64frombits(0x0010000000000000) // The smallest positiv
|
||||||
// multiplied by epsilon.
|
// multiplied by epsilon.
|
||||||
func Equal(a, b, epsilon float64) bool {
|
func Equal(a, b, epsilon float64) bool {
|
||||||
// StaleNaN is a special value that is used as staleness maker, so
|
// StaleNaN is a special value that is used as staleness maker, so
|
||||||
// the two values are equal when both are exactly equals to stale NaN
|
// the two values are equal when both are exactly equals to stale NaN.
|
||||||
if value.IsStaleNaN(a) || value.IsStaleNaN(b) {
|
if value.IsStaleNaN(a) || value.IsStaleNaN(b) {
|
||||||
return value.IsStaleNaN(a) && value.IsStaleNaN(b)
|
return value.IsStaleNaN(a) && value.IsStaleNaN(b)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue