sessioninfo

package
v0.0.0-...-4e8ec41 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Meta

func Meta() *plugin.PluginMeta

Meta returns meta data for testing

Types

type Downloader

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

func NewDownloader

func NewDownloader(pg PageGetter) *Downloader

type PageGetter

type PageGetter func(url string) ([]byte, error)

type Result

type Result struct {
	Tmo_udp               string `xml:"tmo-udp"`
	Tmo_tcp               string `xml:"tmo-tcp"`
	Pps                   string `xml:"pps"`
	Num_max               string `xml:"num-max"`
	Age_scan_thresh       string `xml:"age-scan-thresh"`
	Tmo_tcphalfclosed     string `xml:"tmo-tcphalfclosed"`
	Num_active            string `xml:"num-active"`
	Dis_def               string `xml:"dis-def"`
	Num_mcast             string `xml:"num-mcast"`
	Icmp_unreachable_rate string `xml:"icmp-unreachable-rate"`
	Tmo_tcptimewait       string `xml:"tmo-tcptimewait"`
	Age_scan_ssf          string `xml:"age-scan-ssf"`
	Vardata_rate          string `xml:"vardata-rate"`
	Age_scan_tmo          string `xml:"age-scan-tmo"`
	Tmo_tcpinit           string `xml:"tmo-tcpinit"`
	Dis_tcp               string `xml:"dis-tcp"`
	Num_udp               string `xml:"num-udp"`
	Tmo_icmp              string `xml:"tmo-icmp"`
	Max_pending_mcast     string `xml:"max-pending-mcast"`
	Age_accel_thresh      string `xml:"age-accel-thresh"`
	Tmo_tcphandshake      string `xml:"tmo-tcphandshake"`
	Tmo_def               string `xml:"tmo-def"`
	Age_accel_tsf         string `xml:"age-accel-tsf"`
	Num_icmp              string `xml:"num-icmp"`
	Num_predict           string `xml:"num-predict"`
	Tmo_cp                string `xml:"tmo-cp"`
	Tmo_tcp_unverif_rst   string `xml:"tmo-tcp-unverif-rst"`
	Num_bcast             string `xml:"num-bcast"`
	Num_installed         string `xml:"num-installed"`
	Num_tcp               string `xml:"num-tcp"`
	Dis_udp               string `xml:"dis-udp"`
	Cps                   string `xml:"cps"`
	Kbps                  string `xml:"kbps"`
}

type Session

type Session struct {
	XMLName xml.Name `xml:"response"`
	Status  string   `xml:"status,attr""`
	Result  Result   `xml:"result"`
}

type SessioninfoCollector

type SessioninfoCollector struct {
}

func New

func New() *SessioninfoCollector

func (*SessioninfoCollector) CollectMetrics

func (sessioninfo *SessioninfoCollector) CollectMetrics(mts []plugin.MetricType) (metrics []plugin.MetricType, err error)
CollectMetrics collects metrics for testing.

CollectMetrics() will be called by Snap when a task that collects one of the metrics returned from this plugins GetMetricTypes() is started. The input will include a slice of all the metric types being collected.

The output is the collected metrics as plugin.Metric and an error.

func (*SessioninfoCollector) GetConfigPolicy

func (sessioninfo *SessioninfoCollector) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)

GetConfigPolicy returns plugin configuration

func (*SessioninfoCollector) GetMetricTypes

func (sessioninfo *SessioninfoCollector) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error)

GetMetricTypes returns metric types for testing. GetMetricTypes() will be called when your plugin is loaded in order to populate the metric catalog(where snaps stores all available metrics).

Config info is passed in. This config information would come from global config snap settings.

The metrics returned will be advertised to users who list all the metrics and will become targetable by tasks.

Jump to

Keyboard shortcuts

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