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

Function TestTestRegistry_counter

modules/generator/registry/test_test.go:11–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestTestRegistry_counter(t *testing.T) {
12 testRegistry := NewTestRegistry()
13
14 counter := testRegistry.NewCounter("counter")
15
16 labelValues := buildTestLabels([]string{"foo", "bar"}, []string{"foo-value", "bar-value"})
17 counter.Inc(labelValues, 1.0)
18 counter.Inc(labelValues, 2.0)
19 counter.Inc(labelValues, 1.5)
20
21 lbls := labels.FromMap(map[string]string{
22 "foo": "foo-value",
23 "bar": "bar-value",
24 })
25 assert.Equal(t, 4.5, testRegistry.Query("counter", lbls))
26}
27
28func TestTestRegistry_histogram(t *testing.T) {
29 testRegistry := NewTestRegistry()

Callers

nothing calls this directly

Calls 6

NewCounterMethod · 0.95
IncMethod · 0.95
QueryMethod · 0.95
NewTestRegistryFunction · 0.85
buildTestLabelsFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected