github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/testexporter/correctness/case.go (about) 1 package correctness 2 3 import ( 4 "context" 5 "time" 6 7 v1 "github.com/prometheus/client_golang/api/prometheus/v1" 8 "github.com/prometheus/client_golang/prometheus" 9 "github.com/prometheus/common/model" 10 ) 11 12 // Case is a metric that can be used for exporting a metric and querying it for tests. 13 type Case interface { 14 prometheus.Collector 15 16 Name() string 17 Query(ctx context.Context, client v1.API, selectors string, start time.Time, duration time.Duration) ([]model.SamplePair, error) 18 ExpectedValueAt(time.Time) float64 19 20 MinQueryTime() time.Time 21 Test(ctx context.Context, client v1.API, selectors string, start time.Time, duration time.Duration) (bool, error) 22 Stop() 23 }