Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IfStat ¶
type IfStat struct { Name string RxBytes uint64 RxPackets uint64 RxErrs uint64 RxDrop uint64 RxFIFO uint64 RxFrame uint64 RxCompressed uint64 RxMulticast uint64 TxBytes uint64 TxPackets uint64 TxErrs uint64 TxDrop uint64 TxFIFO uint64 TxColls uint64 TxCarrier uint64 TxCompressed uint64 }
IfStat represents statistics about a network interface.
func ReadIfStats ¶
ReadIfStats is shorthand for DefaultIfStatReader.ReadIfStats.
type IfStatCollector ¶
type IfStatCollector struct {
// contains filtered or unexported fields
}
IfStatCollector computes metrics for network interfaces.
func NewIfStatCollector ¶
func NewIfStatCollector(reader InterfaceStatReader, except *regexp.Regexp) (*IfStatCollector, error)
NewIfStatCollector returns brand new interface stats collector.
type IfStatReader ¶
type IfStatReader struct {
// contains filtered or unexported fields
}
IfStatReader reads statistics for network interfaces.
func NewIfStatReader ¶
func NewIfStatReader(path string) *IfStatReader
NewIfStatReader creates IfStatReader that reads from the specified path. It expects well defined format and may cause panics if it is not present.
func (*IfStatReader) ReadStats ¶
func (r *IfStatReader) ReadStats() ([]IfStat, error)
type InterfaceStatReader ¶
InterfaceStatReader should read statistics for all available network interfaces.
var DefaultIfStatReader InterfaceStatReader = NewIfStatReader("/proc/net/dev")
DefaultIfStatReader is the default implementation of InterfaceStatReader. It reads interface statistics from /proc/net/dev.
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter
|
This file was generated by counterfeiter |