MCPcopy Create free account
hub / github.com/cortexproject/cortex / counterValue

Function counterValue

pkg/util/metrics_helper.go:440–440  ·  view source on GitHub ↗

This works even if m is nil, m.Counter is nil or m.Counter.Value is nil (it returns 0 in those cases)

(m *dto.Metric)

Source from the content-addressed store, hash-verified

438
439// This works even if m is nil, m.Counter is nil or m.Counter.Value is nil (it returns 0 in those cases)
440func counterValue(m *dto.Metric) float64 { return m.GetCounter().GetValue() }
441func gaugeValue(m *dto.Metric) float64 { return m.GetGauge().GetValue() }
442
443// SummaryData keeps all data needed to create summary metric

Callers 1

TestCounterValueFunction · 0.85

Calls 1

GetValueMethod · 0.45

Tested by 1

TestCounterValueFunction · 0.68