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

Function TestCounterValue

pkg/util/metrics_helper_test.go:53–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestCounterValue(t *testing.T) {
54 require.Equal(t, float64(0), counterValue(nil))
55 require.Equal(t, float64(0), counterValue(&dto.Metric{}))
56 require.Equal(t, float64(0), counterValue(&dto.Metric{Counter: &dto.Counter{}}))
57 require.Equal(t, float64(543857.12837), counterValue(&dto.Metric{Counter: &dto.Counter{Value: proto.Float64(543857.12837)}}))
58}
59
60func TestGetMetricsWithLabelNames(t *testing.T) {
61 labels := []string{"a", "b"}

Callers

nothing calls this directly

Calls 2

counterValueFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected