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

Method add

pkg/traceql/engine_metrics_compare.go:535–544  ·  view source on GitHub ↗
(key T, values []float64)

Source from the content-addressed store, hash-verified

533}
534
535func (t *topN[T]) add(key T, values []float64) {
536 sum := 0.0
537 for _, v := range values {
538 sum += v
539 }
540 t.entries = append(t.entries, struct {
541 key T
542 total float64
543 }{key, sum})
544}
545
546// get the top N values. Given as a callback to avoid allocating.
547// bool result indicates if there were more than N values

Callers 2

resultMethod · 0.45
ResultsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected