MCPcopy
hub / github.com/IBM/sarama / histogramValidator

Function histogramValidator

metrics_helpers_test.go:70–82  ·  view source on GitHub ↗
(name string, extraValidator func(*testing.T, metrics.Histogram))

Source from the content-addressed store, hash-verified

68}
69
70func 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
84func countHistogramValidator(name string, expectedCount int) *metricValidator {
85 return histogramValidator(name, func(t *testing.T, histogram metrics.Histogram) {

Callers 5

countHistogramValidatorFunction · 0.85
minMaxHistogramValidatorFunction · 0.85
minValHistogramValidatorFunction · 0.85
maxValHistogramValidatorFunction · 0.85

Calls 2

HelperMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected