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

Function minMaxHistogramValidator

metrics_helpers_test.go:95–107  ·  view source on GitHub ↗

lint:ignore U1000 // this is used but only in unittests which are excluded by the integration build tag

(name string, expectedMin int, expectedMax int)

Source from the content-addressed store, hash-verified

93
94//lint:ignore U1000 // this is used but only in unittests which are excluded by the integration build tag
95func minMaxHistogramValidator(name string, expectedMin int, expectedMax int) *metricValidator {
96 return histogramValidator(name, func(t *testing.T, histogram metrics.Histogram) {
97 t.Helper()
98 min := int(histogram.Min())
99 if min != expectedMin {
100 t.Errorf("Expected histogram metric '%s' min = %d, got %d", name, expectedMin, min)
101 }
102 max := int(histogram.Max())
103 if max != expectedMax {
104 t.Errorf("Expected histogram metric '%s' max = %d, got %d", name, expectedMax, max)
105 }
106 })
107}
108
109func counterValidator(name string, expectedCount int) *metricValidator {
110 return &metricValidator{

Callers 1

validateBrokerMetricsFunction · 0.85

Calls 3

histogramValidatorFunction · 0.85
HelperMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected