MCPcopy
hub / github.com/grafana/tempo / errorRate

Function errorRate

tempodb/encoding/vparquet5/block_traceql_test.go:2016–2029  ·  view source on GitHub ↗
(baselineResults, testResults traceql.SeriesSet)

Source from the content-addressed store, hash-verified

2014}
2015
2016func errorRate(baselineResults, testResults traceql.SeriesSet) (err float64, worstErr float64) {
2017 for k, baseline := range baselineResults {
2018 if test, ok := testResults[k]; ok {
2019 for i := 0; i < len(baseline.Values) && i < len(test.Values); i++ {
2020 err += (baseline.Values[i] - test.Values[i]) * (baseline.Values[i] - test.Values[i])
2021 ePct := math.Abs(baseline.Values[i]-test.Values[i]) / baseline.Values[i]
2022 if ePct > worstErr {
2023 worstErr = ePct
2024 }
2025 }
2026 }
2027 }
2028 return
2029}
2030
2031func ptr[T any](v T) *T {
2032 return &v

Callers 1

TestSamplingErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected