Documentation ¶
Overview ¶
Package basic implements a basic PeerMonitor component for IPFS Cluster. This component is in charge of logging metrics and triggering alerts when a peer goes down.
Index ¶
Constants ¶
const (
DefaultCheckInterval = 15 * time.Second
)
Default values for this Config.
Variables ¶
var AlertChannelCap = 256
AlertChannelCap specifies how much buffer the alerts channel has.
var WindowCap = 10
WindowCap specifies how many metrics to keep for given host and metric type
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.2.0
Config allows to initialize a Monitor and customize some parameters.
func (*Config) ConfigKey ¶ added in v0.2.0
ConfigKey provides a human-friendly identifier for this type of Config.
func (*Config) LoadJSON ¶ added in v0.2.0
LoadJSON sets the fields of this Config to the values defined by the JSON representation of it, as generated by ToJSON.
type Monitor ¶ added in v0.2.0
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is a component in charge of monitoring peers, logging metrics and detecting failures
func NewMonitor ¶ added in v0.2.0
NewMonitor creates a new monitor. It receives the window capacity (how many metrics to keep for each peer and type of metric) and the monitoringInterval (interval between the checks that produce alerts) as parameters
func (*Monitor) Alerts ¶ added in v0.2.0
Alerts returns a channel on which alerts are sent when the monitor detects a failure.
func (*Monitor) LastMetrics ¶ added in v0.2.0
LastMetrics returns last known VALID metrics of a given type. A metric is only valid if it has not expired and belongs to a current cluster peer.