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

Method Value

pkg/usagestats/stats.go:259–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257}
258
259func (s *Statistics) Value() map[string]interface{} {
260 stdvar := s.value.Load() / float64(s.count.Load())
261 stddev := math.Sqrt(stdvar)
262 min := s.min.Load()
263 max := s.max.Load()
264 result := map[string]interface{}{
265 "avg": s.avg.Load(),
266 "count": s.count.Load(),
267 }
268 if !math.IsInf(min, 0) {
269 result["min"] = min
270 }
271 if !math.IsInf(max, 0) {
272 result["max"] = s.max.Load()
273 }
274 if !math.IsNaN(stddev) {
275 result["stddev"] = stddev
276 }
277 if !math.IsNaN(stdvar) {
278 result["stdvar"] = stdvar
279 }
280 return result
281}
282
283func (s *Statistics) Record(v float64) {
284 for {

Callers 2

TestStatisticFunction · 0.95
StringMethod · 0.95

Calls

no outgoing calls

Tested by 1

TestStatisticFunction · 0.76