correctness

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

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
	Quantized(time.Duration) time.Duration
}

Case is a metric that can query itself.

func NewSimpleTestCase

func NewSimpleTestCase(name string, f func(time.Time) float64) Case

NewSimpleTestCase makes a new simpleTestCase

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner runs a bunch of test cases, periodically checking their value.

func NewRunner

func NewRunner(cfg RunnerConfig) (*Runner, error)

NewRunner makes a new Runner.

func (*Runner) Add

func (r *Runner) Add(tc Case)

Add a new TestCase.

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.

func (*Runner) Stop

func (r *Runner) Stop()

Stop the checking goroutine.

type RunnerConfig

type RunnerConfig struct {
	MinTime TimeValue

	ScrapeInterval time.Duration
	// 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

type TimeValue struct {
	time.Time
	// contains filtered or unexported fields
}

TimeValue is a model.Time that can be used as a flag.

func NewTimeValue

func NewTimeValue(t time.Time) TimeValue

NewTimeValue makes a new TimeValue; will round t down to the nearest midnight.

func (*TimeValue) Set

func (v *TimeValue) Set(s string) error

Set implements flag.Value

func (TimeValue) String

func (v TimeValue) String() string

String implements flag.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL