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

Method init

pkg/traceql/engine_metrics_compare.go:78–96  ·  view source on GitHub ↗
(q *tempopb.QueryRangeRequest, mode AggregateMode)

Source from the content-addressed store, hash-verified

76}
77
78func (m *MetricsCompare) init(q *tempopb.QueryRangeRequest, mode AggregateMode) {
79 switch mode {
80 case AggregateModeRaw:
81 m.intervalMapper = NewIntervalMapperFromReq(q)
82 m.baselines = make(map[Attribute]map[StaticMapKey]*staticWithCounts)
83 m.selections = make(map[Attribute]map[StaticMapKey]*staticWithCounts)
84 m.baselineTotals = make(map[Attribute][]float64)
85 m.selectionTotals = make(map[Attribute][]float64)
86 m.maxExemplars = q.Exemplars
87
88 case AggregateModeSum:
89 m.seriesAgg = NewSimpleCombiner(q, sumAggregation)
90 return
91
92 case AggregateModeFinal:
93 m.seriesAgg = NewBaselineAggregator(q, m.topN, q.Exemplars)
94 return
95 }
96}
97
98func (m *MetricsCompare) isSelection(span Span, spanStartTime uint64) Static {
99 // Determine if this span is inside the selection

Callers

nothing calls this directly

Calls 3

NewIntervalMapperFromReqFunction · 0.85
NewSimpleCombinerFunction · 0.85
NewBaselineAggregatorFunction · 0.85

Tested by

no test coverage detected