MCPcopy Index your code
hub / github.com/cortexproject/cortex / compareSampleValue

Function compareSampleValue

tools/querytee/response_comparator.go:208–219  ·  view source on GitHub ↗
(first, second model.SampleValue, tolerance float64)

Source from the content-addressed store, hash-verified

206}
207
208func compareSampleValue(first, second model.SampleValue, tolerance float64) bool {
209 f := float64(first)
210 s := float64(second)
211
212 if math.IsNaN(f) && math.IsNaN(s) {
213 return true
214 } else if tolerance <= 0 {
215 return math.Float64bits(f) == math.Float64bits(s)
216 }
217
218 return math.Abs(f-s) <= tolerance
219}

Callers 1

compareSamplePairFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected