Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResults ¶
type CheckResults struct { Valid []int // each position corresponds to a validator // categories of invalid responses Empty int Timeout int Other int FirstOther *Response }
final outcome of check results
func CheckMT ¶
func CheckMT(endpoints []int, query, from string, dur time.Duration, reqs int, validators ...Validator) CheckResults
checkMT queries all provided MT endpoints and provides a summary of all the outcomes; meaning the counts of each response matching each validator function, and the number of timeouts, and finally all others (non-timeouting invalid responses) we recommend for 60s duration to use 6000 requests, e.g. 100 per second
type Comparator ¶
func Eq ¶
func Eq(good float64) Comparator
func Ge ¶
func Ge(good float64) Comparator
type Point ¶
func (*Point) UnmarshalJSON ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response is a convenience type: it provides original http and json decode errors, if applicable and also the decoded response body, if any
func RetryGraphite ¶
func RetryGraphite8080 ¶
type Validator ¶
func ValidateCode ¶
ValidaterCode returns a validator that validates whether the response has the given code
func ValidateCorrect ¶
ValidateCorrect returns a validator with a min number, which will validate whether we received a "sufficiently correct" response. We assume the response corresponds to a sumSeries() query of multiple series, typically across shards across different instances. the number denotes the minimum accepted value. e.g. with 12, all points must equal 12 (i.e. for the use case of 12 series (1 for each shard, and each series valued at 1) all data from all shards is incorporated) to allow 4 shards being down and unaccounted for, pass 8. NOTE: 8 points are ignored (see comments further down) so you should only call this for sufficiently long series, e.g. 15 points or so.
func ValidateTargets ¶
ValidateTargets returns a function that validates that the response contains exactly all named targets
func ValidatorAvgWindowed ¶
func ValidatorAvgWindowed(numPoints int, cmp Comparator) Validator
ValidatorAvgWindowed returns a validator that validates the number of series and the avg value of each series it is windowed to allow the dataset to include one or two values that would be evened out by a value just outside of the response. For example: response: NaN 4 4 4 5 3 4 4 4 5 clearly here we can trust that if the avg value should be 4, that there would be a 3 coming after the response but we don't want to wait for that. NOTE: ignores up to 2 points from each series, adjust your input size accordingly for desired confidence
func ValidatorLenNulls ¶
ValidatorLenNulls returns a validator that validates that any of the series contained within the response, has a length of l and no more than prefix nulls up front.