diff --git a/pkg/stat/metric/gauge_test.go b/pkg/stat/metric/gauge_test.go index 36faec5a7..b3cb26d22 100644 --- a/pkg/stat/metric/gauge_test.go +++ b/pkg/stat/metric/gauge_test.go @@ -21,32 +21,3 @@ func TestGaugeSet(t *testing.T) { val := gauge.Value() assert.Equal(t, val, int64(50)) } - -func TestGaugeVec(t *testing.T) { - gaugeVec := NewGaugeVec(&GaugeVecOpts{ - Namespace: "test", - Subsystem: "test", - Name: "test", - Help: "this is test metrics.", - Labels: []string{"name", "addr"}, - }) - gaugeVec.Set(float64(22.33), "name1", "127.0.0.1") - assert.Panics(t, func() { - NewGaugeVec(&GaugeVecOpts{ - Namespace: "test", - Subsystem: "test", - Name: "test", - Help: "this is test metrics.", - Labels: []string{"name", "addr"}, - }) - }, "Expected to panic.") - assert.NotPanics(t, func() { - NewGaugeVec(&GaugeVecOpts{ - Namespace: "test", - Subsystem: "test", - Name: "test2", - Help: "this is test metrics.", - Labels: []string{"name", "addr"}, - }) - }, "Expected normal. no panic.") -} diff --git a/pkg/stat/metric/histogram_test.go b/pkg/stat/metric/histogram_test.go deleted file mode 100644 index 72793dc6a..000000000 --- a/pkg/stat/metric/histogram_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package metric - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHistogramVec(t *testing.T) { - histogramVec := NewHistogramVec(&HistogramVecOpts{ - Namespace: "test", - Subsystem: "test", - Name: "test", - Help: "this is test metrics.", - Labels: []string{"name", "addr"}, - Buckets: _defaultBuckets, - }) - histogramVec.Observe(int64(1), "name1", "127.0.0.1") - assert.Panics(t, func() { - NewHistogramVec(&HistogramVecOpts{ - Namespace: "test", - Subsystem: "test", - Name: "test", - Help: "this is test metrics.", - Labels: []string{"name", "addr"}, - Buckets: _defaultBuckets, - }) - }, "Expected to panic.") - assert.NotPanics(t, func() { - NewHistogramVec(&HistogramVecOpts{ - Namespace: "test", - Subsystem: "test", - Name: "test2", - Help: "this is test metrics.", - Labels: []string{"name", "addr"}, - Buckets: _defaultBuckets, - }) - }, "Expected normal. no panic.") -}