mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
0727e017c4
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
18 lines
518 B
Go
18 lines
518 B
Go
package testutils
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/testutil"
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
// PromMetricsSuite is a util suite wrapper providing prometheus metrics assertion functions.
|
|
type PromMetricsSuite struct {
|
|
suite.Suite
|
|
}
|
|
|
|
func (suite *PromMetricsSuite) MetricsEqual(c prometheus.Collector, expect float64, msgAndArgs ...any) bool {
|
|
value := testutil.ToFloat64(c)
|
|
return suite.Suite.Equal(expect, value, msgAndArgs...)
|
|
}
|