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

Function GetCounterValue

pkg/util/test/metrics.go:8–15  ·  view source on GitHub ↗
(metric prometheus.Counter)

Source from the content-addressed store, hash-verified

6)
7
8func GetCounterValue(metric prometheus.Counter) (float64, error) {
9 m := &dto.Metric{}
10 err := metric.Write(m)
11 if err != nil {
12 return 0, err
13 }
14 return m.Counter.GetValue(), nil
15}
16
17func GetGaugeValue(metric prometheus.Gauge) (float64, error) {
18 m := &dto.Metric{}

Callers 7

TestSLOHookFunction · 0.92
TestBadRequestFunction · 0.92
TestCanceledRequestFunction · 0.92
ctrValFunction · 0.92
MustGetCounterValueFunction · 0.85

Calls 2

WriteMethod · 0.65
GetValueMethod · 0.45

Tested by 6

TestSLOHookFunction · 0.74
TestBadRequestFunction · 0.74
TestCanceledRequestFunction · 0.74
ctrValFunction · 0.74