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

Function getCounterVecValue

modules/livestore/metrics_test.go:212–219  ·  view source on GitHub ↗
(metric *prometheus.CounterVec, labels ...string)

Source from the content-addressed store, hash-verified

210}
211
212func getCounterVecValue(metric *prometheus.CounterVec, labels ...string) (float64, error) {
213 m := &dto.Metric{}
214 err := metric.WithLabelValues(labels...).Write(m)
215 if err != nil {
216 return 0, err
217 }
218 return m.Counter.GetValue(), nil
219}
220
221func getHistogramCount(t *testing.T, histogram prometheus.Histogram) float64 {
222 m := &dto.Metric{}

Calls 2

WriteMethod · 0.65
GetValueMethod · 0.45

Tested by

no test coverage detected