Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AppDeniedMetric = &appDeniedMetric{}
AppDeniedMetric is a special metric indicating a "denied" situation
var ErrAppDenied = errors.New("App denied")
ErrAppDenied is seen when an app is denied access
var ErrInvalidCheckType = errors.New("Unknown throttler check type")
ErrInvalidCheckType is an internal error indicating an unknown check type
var ErrNoSuchMetric = errors.New("No such metric")
ErrNoSuchMetric is for when a user requests a metric by an unknown metric name
var ErrThresholdExceeded = errors.New("Threshold exceeded")
ErrThresholdExceeded is the common error one may get checking on metric result
var NoHostsMetricResult = &noHostsMetricResult{}
NoHostsMetricResult is a result indicating "no hosts"
var NoMetricResultYet = &noMetricResultYet{}
NoMetricResultYet is a result indicating "no data"
var NoSuchMetric = &noSuchMetric{}
NoSuchMetric is a metric results for an unknown metric name
Functions ¶
func IsDialTCPError ¶
IsDialTCPError sees if th egiven error indicates a TCP issue
Types ¶
type AppThrottle ¶
AppThrottle is the definition for an app throttling instruction - Ratio: [0..1], 0 == no throttle, 1 == fully throttle
func NewAppThrottle ¶
NewAppThrottle creates an AppThrottle struct
type MetricHealth ¶
MetricHealth is a health status for a metric, and more specifically, when it was last checked to be "OK"
func NewMetricHealth ¶
func NewMetricHealth(lastHealthyAt time.Time) *MetricHealth
NewMetricHealth returns a MetricHealth
type MetricHealthMap ¶
type MetricHealthMap map[string](*MetricHealth)
MetricHealthMap maps metric names to metric healths
func (MetricHealthMap) Aggregate ¶
func (m MetricHealthMap) Aggregate(other MetricHealthMap) MetricHealthMap
Aggregate another map into this map, take the worst metric of the two
type MetricResult ¶
MetricResult is what we expect our probes to return. This can be a numeric result, or a special type of result indicating more meta-information
func NewSimpleMetricResult ¶
func NewSimpleMetricResult(value float64) MetricResult
NewSimpleMetricResult creates a simpleMetricResult
type MetricResultFunc ¶
type MetricResultFunc func() (metricResult MetricResult, threshold float64)
MetricResultFunc is a function that returns a metric result