Documentation ¶
Overview ¶
Package probe implements the ways Revere can measure the outside world.
Index ¶
- Constants
- type Checker
- type Details
- type GraphiteThreshold
- type GraphiteThresholdDBModel
- type GraphiteThresholdProbe
- func (g GraphiteThresholdProbe) HasResource(id db.ResourceID) bool
- func (g GraphiteThresholdProbe) SerializeForDB() (string, error)
- func (g GraphiteThresholdProbe) SerializeForFrontend() map[string]string
- func (g GraphiteThresholdProbe) Type() VMType
- func (g GraphiteThresholdProbe) Validate() (errs []string)
- type GraphiteThresholdThresholdsDBModel
- type GraphiteThresholdType
- type Polling
- type Probe
- type Reading
- type ThresholdsModel
- type VM
- type VMType
Constants ¶
const (
ProbesDir = "probes"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker interface {
Check() []Reading
}
Checker is used by Polling to actually check the thing being monitored.
type Details ¶
type Details interface { // Text returns a human-readable description of these details. The // description may be multiple lines, though it should not end with a line // break. Text() string }
Details encodes probe-type-specific details from a reading.
type GraphiteThreshold ¶
type GraphiteThreshold struct { *Polling // contains filtered or unexported fields }
GraphiteThreshold implements a probe that assigns states based on whether a Graphite metric is above or below various constant values.
func (*GraphiteThreshold) Check ¶
func (gt *GraphiteThreshold) Check() []Reading
type GraphiteThresholdDBModel ¶
type GraphiteThresholdDBModel struct { ResourceID int64 Expression string Thresholds GraphiteThresholdThresholdsDBModel TriggerIf string CheckPeriodMilli int64 TimeToAuditMilli int64 RecentTimeToIgnoreMilli int64 AuditFunction string }
GraphiteThresholdDBModel defines the JSON serialization format for saving Graphite threshold probes' settings in the database.
type GraphiteThresholdProbe ¶
type GraphiteThresholdProbe struct { GraphiteThresholdType URL string ResourceID db.ResourceID Expression string Thresholds ThresholdsModel AuditFunction string CheckPeriod int64 CheckPeriodType string TriggerIf string AuditPeriod int64 AuditPeriodType string IgnoredPeriod int64 IgnoredPeriodType string }
func (GraphiteThresholdProbe) HasResource ¶
func (g GraphiteThresholdProbe) HasResource(id db.ResourceID) bool
func (GraphiteThresholdProbe) SerializeForDB ¶
func (g GraphiteThresholdProbe) SerializeForDB() (string, error)
func (GraphiteThresholdProbe) SerializeForFrontend ¶
func (g GraphiteThresholdProbe) SerializeForFrontend() map[string]string
func (GraphiteThresholdProbe) Type ¶
func (g GraphiteThresholdProbe) Type() VMType
func (GraphiteThresholdProbe) Validate ¶
func (g GraphiteThresholdProbe) Validate() (errs []string)
type GraphiteThresholdThresholdsDBModel ¶
type GraphiteThresholdThresholdsDBModel struct { Warning *float64 Error *float64 Critical *float64 }
GraphiteThresholdThresholdsDBModel defines the JSON serialization format for saving Graphite threshold probes' threshold settings in the database.
type GraphiteThresholdType ¶
type GraphiteThresholdType struct{}
func (GraphiteThresholdType) AcceptedResourceTypes ¶
func (GraphiteThresholdType) AcceptedResourceTypes() []db.ResourceType
func (GraphiteThresholdType) Id ¶
func (GraphiteThresholdType) Id() db.ProbeType
func (GraphiteThresholdType) Name ¶
func (GraphiteThresholdType) Name() string
func (GraphiteThresholdType) Scripts ¶
func (gt GraphiteThresholdType) Scripts() map[string][]string
func (GraphiteThresholdType) Templates ¶
func (GraphiteThresholdType) Templates() map[string]string
type Polling ¶
type Polling struct {
// contains filtered or unexported fields
}
Polling helps implement probes that check conditions at regular intervals. Embed a pointer to this struct in a struct that implements Checker to get such a polling probe without having to deal with the polling loop.
func NewPolling ¶
type Probe ¶
type Probe interface { Start() Stop() }
Probe defines a common functional abstraction for all probes.
TODO(eefi): Pull in the probe concept explanation text from the Revere product overview design doc. Also document all the individual methods.
TODO(eefi): Incorporate the web side and also document that.