(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func 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 | |
| 28 | func TestTestRegistry_histogram(t *testing.T) { |
| 29 | testRegistry := NewTestRegistry() |
nothing calls this directly
no test coverage detected