Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case interface { prometheus.Collector Name() string Query(ctx context.Context, client v1.API, selectors string, start time.Time, duration time.Duration) ([]model.SamplePair, error) ExpectedValueAt(time.Time) float64 MinQueryTime() time.Time Test(ctx context.Context, client v1.API, selectors string, start time.Time, duration time.Duration) (bool, error) Stop() }
Case is a metric that can be used for exporting a metric and querying it for tests.
func NewDeleteSeriesTest ¶ added in v1.2.0
func NewDeleteSeriesTest(name string, f func(time.Time) float64, cfg DeleteSeriesTestConfig, commonTestConfig CommonTestConfig) Case
func NewSimpleTestCase ¶
NewSimpleTestCase makes a new simpleTestCase
type CommonTestConfig ¶ added in v1.2.0
type CommonTestConfig struct { ScrapeInterval time.Duration // contains filtered or unexported fields }
func (*CommonTestConfig) RegisterFlags ¶ added in v1.2.0
func (cfg *CommonTestConfig) RegisterFlags(f *flag.FlagSet)
type DeleteSeriesTest ¶ added in v1.2.0
type DeleteSeriesTest struct { Case // contains filtered or unexported fields }
DeleteSeriesTest would keep deleting data for configured duration at configured interval. Test method would check whether we are getting expected data by eliminating deleted samples while non deleted ones stays untouched. For simplification it would not test samples from the start time of last sent delete request and just treat it as passed.
func (*DeleteSeriesTest) MinQueryTime ¶ added in v1.2.0
func (d *DeleteSeriesTest) MinQueryTime() time.Time
func (*DeleteSeriesTest) Stop ¶ added in v1.2.0
func (d *DeleteSeriesTest) Stop()
type DeleteSeriesTestConfig ¶ added in v1.2.0
type DeleteSeriesTestConfig struct { PrometheusAddr string ExtraSelectors string UserID string // contains filtered or unexported fields }
func (*DeleteSeriesTestConfig) RegisterFlags ¶ added in v1.2.0
func (cfg *DeleteSeriesTestConfig) RegisterFlags(f *flag.FlagSet)
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner runs a bunch of test cases, periodically checking their value.
func (*Runner) Collect ¶
func (r *Runner) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Runner) Describe ¶
func (r *Runner) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type RunnerConfig ¶
type RunnerConfig struct { PrometheusAddr string UserID string ExtraSelectors string EnableDeleteSeriesTest bool CommonTestConfig CommonTestConfig DeleteSeriesTestConfig DeleteSeriesTestConfig // contains filtered or unexported fields }
RunnerConfig is config, for the runner.
func (*RunnerConfig) RegisterFlags ¶
func (cfg *RunnerConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags does what it says.
type TimeValue ¶
TimeValue is a model.Time that can be used as a flag.
func NewTimeValue ¶
NewTimeValue makes a new TimeValue; will round t down to the nearest midnight.