ping

package
v0.0.0-...-e49dbe6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of plugin
	Name = "ping"
	// Version of plugin
	Version = 1
	// Type of plugin
	Type = plugin.CollectorPluginType
)

Variables

View Source
var GlobalPinger *pinger.Pinger

global co-oridinator shared between all go-routines.

Functions

func Meta

func Meta() *plugin.PluginMeta

Meta returns meta data for testing

Types

type Ping

type Ping struct {
}

func New

func New() *Ping

func (*Ping) CollectMetrics

func (p *Ping) CollectMetrics(mts []plugin.MetricType) ([]plugin.MetricType, error)

CollectMetrics collects metrics for testing

func (*Ping) GetConfigPolicy

func (p *Ping) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)

GetConfigPolicy returns a ConfigPolicyTree for testing

func (*Ping) GetMetricTypes

func (p *Ping) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error)

GetMetricTypes returns metric types for testing

type PingResult

type PingResult struct {
	Loss   *float64
	Min    *float64
	Max    *float64
	Avg    *float64
	Median *float64
	Mdev   *float64
}

results. we use pointers so that missing data will be encoded as 'null' in the json response.

type RaintankProbePing

type RaintankProbePing struct {
	Hostname string
	Count    int
	Timeout  time.Duration
}

Our check definition.

func NewRaintankPingProbe

func NewRaintankPingProbe(hostname string, count int, timeout float64) (*RaintankProbePing, error)

parse the json request body to build our check definition.

func (*RaintankProbePing) Run

func (p *RaintankProbePing) Run() (*PingResult, error)

Jump to

Keyboard shortcuts

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