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

Method updateSeries

modules/generator/registry/histogram.go:155–171  ·  view source on GitHub ↗
(hash uint64, s *histogramSeries, value float64, traceID string, multiplier float64)

Source from the content-addressed store, hash-verified

153}
154
155func (h *histogram) updateSeries(hash uint64, s *histogramSeries, value float64, traceID string, multiplier float64) {
156 s.count.Add(1 * multiplier)
157 s.sum.Add(value * multiplier)
158
159 for i, bucket := range h.buckets {
160 if value <= bucket {
161 s.buckets[i].Add(1 * multiplier)
162 }
163 }
164
165 bucket := sort.SearchFloat64s(h.buckets, value)
166 s.exemplars[bucket].Store(traceID)
167 s.exemplarValues[bucket].Store(value)
168
169 s.lastUpdated.Store(time.Now().UnixMilli())
170 h.lifecycler.OnUpdate(hash, h.activeSeriesPerHistogramSerie())
171}
172
173func (h *histogram) name() string {
174 return h.metricName

Callers 2

ObserveWithExemplarMethod · 0.95
newSeriesMethod · 0.95

Calls 5

AddMethod · 0.65
StoreMethod · 0.65
NowMethod · 0.65
OnUpdateMethod · 0.65

Tested by

no test coverage detected