MCPcopy
hub / github.com/go-kit/kit / TestMultiCounter

Function TestMultiCounter

metrics/multi/multi_test.go:10–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestMultiCounter(t *testing.T) {
11 c1 := &mockCounter{}
12 c2 := &mockCounter{}
13 c3 := &mockCounter{}
14 mc := NewCounter(c1, c2, c3)
15
16 mc.Add(123)
17 mc.Add(456)
18
19 want := "[123 456]"
20 for i, m := range []fmt.Stringer{c1, c2, c3} {
21 if have := m.String(); want != have {
22 t.Errorf("c%d: want %q, have %q", i+1, want, have)
23 }
24 }
25}
26
27func TestMultiGauge(t *testing.T) {
28 g1 := &mockGauge{}

Callers

nothing calls this directly

Calls 3

AddMethod · 0.95
NewCounterFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…