(name string, extraValidator func(*testing.T, metrics.Histogram))
| 68 | } |
| 69 | |
| 70 | func histogramValidator(name string, extraValidator func(*testing.T, metrics.Histogram)) *metricValidator { |
| 71 | return &metricValidator{ |
| 72 | name: name, |
| 73 | validator: func(t *testing.T, metric any) { |
| 74 | t.Helper() |
| 75 | if histogram, ok := metric.(metrics.Histogram); !ok { |
| 76 | t.Errorf("Expected histogram metric for '%s', got %T", name, metric) |
| 77 | } else { |
| 78 | extraValidator(t, histogram) |
| 79 | } |
| 80 | }, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | func countHistogramValidator(name string, expectedCount int) *metricValidator { |
| 85 | return histogramValidator(name, func(t *testing.T, histogram metrics.Histogram) { |
no test coverage detected