Documentation ¶
Overview ¶
This codebase originates from https://github.com/github/freno, See https://github.com/github/freno/blob/master/LICENSE
MIT License Copyright (c) 2017 GitHub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 the given 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