diff options
Diffstat (limited to 'vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go')
-rw-r--r-- | vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go index 5a20f4b6b..d1242e08d 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram_test.go @@ -119,28 +119,6 @@ func BenchmarkHistogramWrite8(b *testing.B) { benchmarkHistogramWrite(8, b) } -func TestHistogramNonMonotonicBuckets(t *testing.T) { - testCases := map[string][]float64{ - "not strictly monotonic": {1, 2, 2, 3}, - "not monotonic at all": {1, 2, 4, 3, 5}, - "have +Inf in the middle": {1, 2, math.Inf(+1), 3}, - } - for name, buckets := range testCases { - func() { - defer func() { - if r := recover(); r == nil { - t.Errorf("Buckets %v are %s but NewHistogram did not panic.", buckets, name) - } - }() - _ = NewHistogram(HistogramOpts{ - Name: "test_histogram", - Help: "helpless", - Buckets: buckets, - }) - }() - } -} - // Intentionally adding +Inf here to test if that case is handled correctly. // Also, getCumulativeCounts depends on it. var testBuckets = []float64{-2, -1, -0.5, 0, 0.5, 1, 2, math.Inf(+1)} @@ -286,7 +264,7 @@ func TestHistogramVecConcurrency(t *testing.T) { for i := 0; i < vecLength; i++ { m := &dto.Metric{} s := his.WithLabelValues(string('A' + i)) - s.(Histogram).Write(m) + s.Write(m) if got, want := len(m.Histogram.Bucket), len(testBuckets)-1; got != want { t.Errorf("got %d buckets in protobuf, want %d", got, want) |