basic

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2017 License: MIT Imports: 8 Imported by: 0

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

This section is empty.

Variables

View Source
var AlertChannelCap = 256

AlertChannelCap specifies how much buffer the alerts channel has.

View Source
var WindowCap = 10

WindowCap specifies how many metrics to keep for given host and metric type

Functions

This section is empty.

Types

type StdPeerMonitor

type StdPeerMonitor struct {
	// contains filtered or unexported fields
}

StdPeerMonitor is a component in charge of monitoring peers, logging metrics and detecting failures

func NewStdPeerMonitor

func NewStdPeerMonitor(monIntervalSecs int) *StdPeerMonitor

NewStdPeerMonitor 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 (*StdPeerMonitor) Alerts

func (mon *StdPeerMonitor) Alerts() <-chan api.Alert

Alerts returns a channel on which alerts are sent when the monitor detects a failure.

func (*StdPeerMonitor) LastMetrics

func (mon *StdPeerMonitor) LastMetrics(name string) []api.Metric

LastMetrics returns last known VALID metrics of a given type

func (*StdPeerMonitor) LogMetric

func (mon *StdPeerMonitor) LogMetric(m api.Metric)

LogMetric stores a metric so it can later be retrieved.

func (*StdPeerMonitor) SetClient

func (mon *StdPeerMonitor) SetClient(c *rpc.Client)

SetClient saves the given rpc.Client for later use

func (*StdPeerMonitor) Shutdown

func (mon *StdPeerMonitor) Shutdown() error

Shutdown stops the peer monitor. It particular, it will not deliver any alerts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL