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

Function errorRate

tempodb/encoding/vparquet4/block_traceql_test.go:1766–1779  ·  view source on GitHub ↗
(baselineResults, testResults traceql.SeriesSet)

Source from the content-addressed store, hash-verified

1764}
1765
1766func errorRate(baselineResults, testResults traceql.SeriesSet) (err float64, worstErr float64) {
1767 for k, baseline := range baselineResults {
1768 if test, ok := testResults[k]; ok {
1769 for i := 0; i < len(baseline.Values) && i < len(test.Values); i++ {
1770 err += (baseline.Values[i] - test.Values[i]) * (baseline.Values[i] - test.Values[i])
1771 ePct := math.Abs(baseline.Values[i]-test.Values[i]) / baseline.Values[i]
1772 if ePct > worstErr {
1773 worstErr = ePct
1774 }
1775 }
1776 }
1777 }
1778 return
1779}
1780
1781func ptr[T any](v T) *T {
1782 return &v

Callers 1

TestSamplingErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected