Documentation ¶
Index ¶
- func IsValidMonitor(name string) bool
- func Monitors() []string
- type CPUMetadata
- type CPUMonitor
- func (c *CPUMonitor) CheckConfig(name string, conf MonitorConf)
- func (c *CPUMonitor) DefaultConfig() *MonitorConf
- func (c *CPUMonitor) Flush(encoder *json.Encoder) error
- func (c *CPUMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
- func (c *CPUMonitor) Run(ctx context.Context) error
- type CmdLineToolMetadata
- type CmdLineToolMonitor
- func (c *CmdLineToolMonitor) CheckConfig(name string, conf MonitorConf)
- func (c *CmdLineToolMonitor) DefaultConfig() *MonitorConf
- func (c *CmdLineToolMonitor) Flush(encoder *json.Encoder) error
- func (c *CmdLineToolMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
- func (c *CmdLineToolMonitor) Run(ctx context.Context) error
- type IOMetadata
- type IOMonitor
- func (i *IOMonitor) CheckConfig(name string, conf MonitorConf)
- func (i *IOMonitor) DefaultConfig() *MonitorConf
- func (i *IOMonitor) Flush(encoder *json.Encoder) error
- func (i *IOMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
- func (i *IOMonitor) Run(ctx context.Context) error
- type MemoryMetadata
- type MemoryMonitor
- func (m *MemoryMonitor) CheckConfig(name string, conf MonitorConf)
- func (m *MemoryMonitor) DefaultConfig() *MonitorConf
- func (m *MemoryMonitor) Flush(encoder *json.Encoder) error
- func (m *MemoryMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
- func (m *MemoryMonitor) Run(ctx context.Context) error
- type MetadataGenerator
- func GetMonitor(name string) MetadataGenerator
- func NewCPUMonitor() MetadataGenerator
- func NewCmdLineToolMonitor() MetadataGenerator
- func NewIOMonitor() MetadataGenerator
- func NewMemoryMonitor() MetadataGenerator
- func NewNetstatMonitor() MetadataGenerator
- func NewRTTMonitor() MetadataGenerator
- func NewSsMonitor() MetadataGenerator
- type Monitor
- type MonitorConf
- type NetstatMetadata
- type NetstatMonitor
- func (n *NetstatMonitor) CheckConfig(name string, conf MonitorConf)
- func (n *NetstatMonitor) DefaultConfig() *MonitorConf
- func (n *NetstatMonitor) Flush(encoder *json.Encoder) error
- func (n *NetstatMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
- func (n *NetstatMonitor) Run(ctx context.Context) error
- type RTTMetadata
- type RTTMonitor
- func (r *RTTMonitor) CheckConfig(name string, conf MonitorConf)
- func (r *RTTMonitor) DefaultConfig() *MonitorConf
- func (r *RTTMonitor) Flush(encoder *json.Encoder) error
- func (r *RTTMonitor) Init(name string, verbose bool, defaultInterval time.Duration, conf MonitorConf) error
- func (r *RTTMonitor) Run(ctx context.Context) error
- type SsMetadata
- type SsMonitor
- func (s *SsMonitor) CheckConfig(name string, conf MonitorConf)
- func (s *SsMonitor) DefaultConfig() *MonitorConf
- func (s *SsMonitor) Flush(encoder *json.Encoder) error
- func (s *SsMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
- func (s *SsMonitor) Run(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidMonitor ¶
IsValidMonitor returns a bool indicating whether the string is the name of a valid monitor
Types ¶
type CPUMetadata ¶
type CPUMetadata struct { Timestamp time.Time `json:"timestamp"` CPU map[string]float64 `json:"cpuidle"` }
CPUMetadata encapsulates what it says
type CPUMonitor ¶
type CPUMonitor struct { Monitor Data []CPUMetadata `json:"data"` }
CPUMonitor collects cpu usage metadata
func (*CPUMonitor) CheckConfig ¶
func (c *CPUMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*CPUMonitor) DefaultConfig ¶ added in v1.4.0
func (c *CPUMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default
func (*CPUMonitor) Flush ¶
func (c *CPUMonitor) Flush(encoder *json.Encoder) error
Flush will write any current metadata to the writer
func (*CPUMonitor) Init ¶
func (c *CPUMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
Init initializes a CPUMonitor
type CmdLineToolMetadata ¶ added in v1.3.4
type CmdLineToolMetadata struct { Timestamp time.Time `json:"timestamp"` ToolOutput string `json:"tooloutput"` }
CmdLineToolMetadata encapsulates what it says
type CmdLineToolMonitor ¶ added in v1.3.4
type CmdLineToolMonitor struct { Monitor CmdLineToolOptions []string `json:"cmdlineoptions"` Data []CmdLineToolMetadata `json:"data"` }
CmdLineToolMonitor collects metadata from the linux ss tool
func (*CmdLineToolMonitor) CheckConfig ¶ added in v1.3.4
func (c *CmdLineToolMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*CmdLineToolMonitor) DefaultConfig ¶ added in v1.4.0
func (c *CmdLineToolMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default
func (*CmdLineToolMonitor) Flush ¶ added in v1.3.4
func (c *CmdLineToolMonitor) Flush(encoder *json.Encoder) error
Flush will write any current metadata to the writer
func (*CmdLineToolMonitor) Init ¶ added in v1.3.4
func (c *CmdLineToolMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
Init initializes an CmdLineToolMonitor
type IOMetadata ¶
type IOMetadata struct { Timestamp time.Time `json:"timestamp"` Counters map[string]disk.IOCountersStat `json:"counters"` }
IOMetadata encapsulates what it says
type IOMonitor ¶
type IOMonitor struct { Monitor Data []IOMetadata `json:"data"` // contains filtered or unexported fields }
IOMonitor collects io/disk usage metadata
func (*IOMonitor) CheckConfig ¶
func (i *IOMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*IOMonitor) DefaultConfig ¶ added in v1.4.0
func (i *IOMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default
type MemoryMetadata ¶
type MemoryMetadata struct { Timestamp time.Time `json:"timestamp"` UsedPercent float64 `json:"percent_used"` }
MemoryMetadata encapsulates what it says
type MemoryMonitor ¶
type MemoryMonitor struct { Monitor Data []MemoryMetadata `json:"data"` }
MemoryMonitor collects memory usage metadata
func (*MemoryMonitor) CheckConfig ¶
func (m *MemoryMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*MemoryMonitor) DefaultConfig ¶ added in v1.4.0
func (m *MemoryMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default
func (*MemoryMonitor) Flush ¶
func (m *MemoryMonitor) Flush(encoder *json.Encoder) error
Flush will write any current metadata to the writer
func (*MemoryMonitor) Init ¶
func (m *MemoryMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
Init initialize a MemoryMonitor
type MetadataGenerator ¶
type MetadataGenerator interface { Init(string, bool, time.Duration, MonitorConf) error Run(context.Context) error Flush(*json.Encoder) error CheckConfig(string, MonitorConf) DefaultConfig() *MonitorConf }
MetadataGenerator is the interface that all metadata sources must adhere to
func GetMonitor ¶
func GetMonitor(name string) MetadataGenerator
GetMonitor returns a pointer to a MetadataGenerator given a name, or nil if no such monitor exists
func NewCPUMonitor ¶
func NewCPUMonitor() MetadataGenerator
NewCPUMonitor creates and returns a new CPUMonitor
func NewCmdLineToolMonitor ¶ added in v1.3.4
func NewCmdLineToolMonitor() MetadataGenerator
NewCmdLineToolMonitor creates and returns a new NetstatMonitor
func NewIOMonitor ¶
func NewIOMonitor() MetadataGenerator
NewIOMonitor creates and returns a new IOMonitor
func NewMemoryMonitor ¶
func NewMemoryMonitor() MetadataGenerator
NewMemoryMonitor creates and returns a new MemoryMonitor
func NewNetstatMonitor ¶
func NewNetstatMonitor() MetadataGenerator
NewNetstatMonitor creates and returns a new NetstatMonitor
func NewRTTMonitor ¶
func NewRTTMonitor() MetadataGenerator
NewRTTMonitor creates and returns a new RTTMonitor
func NewSsMonitor ¶
func NewSsMonitor() MetadataGenerator
NewSsMonitor creates and returns a new NetstatMonitor
type Monitor ¶
type Monitor struct { Name string `json:"name"` Kind string `json:"type"` // v1.3 change external name to Kind; keep json as type for back compat // contains filtered or unexported fields }
Monitor encapsulates elements common to all monitors
type MonitorConf ¶
type MonitorConf struct { Kind string // all monitors Interval time.Duration // all monitors Device []string // netstat, io, rtt RttType string // rtt Dest string // rtt MaxTTL int // rtt AllHops bool // rtt CmdOpts []string // ss, cmdlinetool }
MonitorConf defines a configuration for a monitor
func MonitorConfFromStringMap ¶
func MonitorConfFromStringMap(kind string, strconfig map[string]string) (MonitorConf, error)
MonitorConfFromStringMap constructs a MonitorConf from a str map from command line
func (*MonitorConf) String ¶
func (m *MonitorConf) String() string
String method - a slightly nicer repr of MonitorConf
type NetstatMetadata ¶
type NetstatMetadata struct { Timestamp time.Time `json:"timestamp"` Netstat map[string]net.IOCountersStat `json:"netstat"` }
NetstatMetadata encapsulates what it says
type NetstatMonitor ¶
type NetstatMonitor struct { Monitor Data []NetstatMetadata `json:"data"` // contains filtered or unexported fields }
NetstatMonitor collects network interface counters metadata
func (*NetstatMonitor) CheckConfig ¶
func (n *NetstatMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*NetstatMonitor) DefaultConfig ¶ added in v1.4.0
func (n *NetstatMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default
func (*NetstatMonitor) Flush ¶
func (n *NetstatMonitor) Flush(encoder *json.Encoder) error
Flush will write any current metadata to the writer
func (*NetstatMonitor) Init ¶
func (n *NetstatMonitor) Init(name string, verbose bool, defaultInterval time.Duration, config MonitorConf) error
Init initializes a NetstatMonitor
type RTTMetadata ¶
type RTTMetadata struct { Probes []probe `json:"probes"` PcapStats pcap.Stats `json:"libpcap_stats"` Protocol string `json:"protocol"` Probetype string `json:"probetype"` TotalEmitted int64 `json:"total_probes_emitted"` TotalReceived int64 `json:"total_probes_received"` ProbeAllHops bool `json:"probe_all_hops"` MaxTTL int `json:"maxttl"` IPDest string `json:"dest"` }
RTTMetadata is a slice of probe samples. It implements sort.Interface
func (*RTTMetadata) Append ¶
func (r *RTTMetadata) Append(p *probe)
Append appends a probe record to the metadata
func (*RTTMetadata) Less ¶
func (r *RTTMetadata) Less(i, j int) bool
Less returns true if probe sample i has a send time < probe sample j
func (*RTTMetadata) Swap ¶
func (r *RTTMetadata) Swap(i, j int)
Swap swaps two probe samples in the slice
type RTTMonitor ¶
type RTTMonitor struct { Monitor RTTMetadata // contains filtered or unexported fields }
RTTMonitor collects RTT samples using ICMP
func (*RTTMonitor) CheckConfig ¶
func (r *RTTMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*RTTMonitor) DefaultConfig ¶ added in v1.4.0
func (r *RTTMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default
func (*RTTMonitor) Flush ¶
func (r *RTTMonitor) Flush(encoder *json.Encoder) error
Flush will write any current metadata to the writer
func (*RTTMonitor) Init ¶
func (r *RTTMonitor) Init(name string, verbose bool, defaultInterval time.Duration, conf MonitorConf) error
Init initializes an RTT monitor
type SsMetadata ¶
SsMetadata encapsulates what it says
type SsMonitor ¶
type SsMonitor struct { Monitor SsOptions string `json:"ssoptions"` Data []SsMetadata `json:"data"` }
SsMonitor collects metadata from the linux ss tool
func (*SsMonitor) CheckConfig ¶
func (s *SsMonitor) CheckConfig(name string, conf MonitorConf)
CheckConfig does some basic sanity checking on the configuration
func (*SsMonitor) DefaultConfig ¶ added in v1.4.0
func (s *SsMonitor) DefaultConfig() *MonitorConf
DefaultConfig returns a default config or nil if no default