MCPcopy Create free account
hub / github.com/cortexproject/cortex / RegisterFlags

Method RegisterFlags

pkg/testexporter/correctness/simple.go:50–60  ·  view source on GitHub ↗
(f *flag.FlagSet)

Source from the content-addressed store, hash-verified

48}
49
50func (cfg *CommonTestConfig) RegisterFlags(f *flag.FlagSet) {
51 f.DurationVar(&cfg.testTimeEpsilon, "test-time-epsilion", 1*time.Second, "Amount samples are allowed to be off by")
52 f.Float64Var(&cfg.testEpsilon, "test-epsilion", 0.01, "Amount samples are allowed to be off by this %%")
53 f.DurationVar(&cfg.ScrapeInterval, "scrape-interval", 15*time.Second, "Expected scrape interval.")
54 f.Float64Var(&cfg.samplesEpsilon, "test-samples-epsilon", 0.1, "Amount that the number of samples are allowed to be off by")
55
56 // By default, we only query for values from when this process started
57 cfg.timeQueryStart = NewTimeValue(time.Now())
58 f.Var(&cfg.timeQueryStart, "test-query-start", "Minimum start date for queries")
59 f.DurationVar(&cfg.durationQuerySince, "test-query-since", 0, "Duration in the past to test. Overrides -test-query-start")
60}
61
62// NewSimpleTestCase makes a new simpleTestCase
63func NewSimpleTestCase(name string, f func(time.Time) float64, cfg CommonTestConfig) Case {

Callers

nothing calls this directly

Calls 1

NewTimeValueFunction · 0.85

Tested by

no test coverage detected