(t *testing.T)
| 198 | } |
| 199 | |
| 200 | func Test_gauge_externalLabels(t *testing.T) { |
| 201 | c := newGauge("my_gauge", noopLimiter, map[string]string{"external_label": "external_value"}, 15*time.Minute) |
| 202 | |
| 203 | c.Inc(buildTestLabels([]string{"label"}, []string{"value-1"}), 1.0) |
| 204 | c.Inc(buildTestLabels([]string{"label"}, []string{"value-2"}), 2.0) |
| 205 | |
| 206 | collectionTimeMs := time.Now().UnixMilli() |
| 207 | expectedSamples := []sample{ |
| 208 | newSample(map[string]string{"__name__": "my_gauge", "label": "value-1", "external_label": "external_value"}, collectionTimeMs, 1), |
| 209 | newSample(map[string]string{"__name__": "my_gauge", "label": "value-2", "external_label": "external_value"}, collectionTimeMs, 2), |
| 210 | } |
| 211 | collectMetricAndAssert(t, c, collectionTimeMs, 2, expectedSamples, nil) |
| 212 | } |
| 213 | |
| 214 | func Test_gauge_concurrencyDataRace(t *testing.T) { |
| 215 | c := newGauge("my_gauge", noopLimiter, map[string]string{}, 15*time.Minute) |
nothing calls this directly
no test coverage detected