(f *flag.FlagSet)
| 48 | } |
| 49 | |
| 50 | func (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 |
| 63 | func NewSimpleTestCase(name string, f func(time.Time) float64, cfg CommonTestConfig) Case { |
nothing calls this directly
no test coverage detected