Documentation ¶
Index ¶
- type CPUStats
- type DiskIOStats
- type FSInfos
- type HostInfos
- type InterfaceDuplexType
- type InterfaceInfos
- type InterfaceState
- type MemStats
- type NetIOStats
- type PageStats
- type ProcessStats
- type Stat
- func (s *Stat) CPUStats() *CPUStats
- func (s *Stat) DiskIOStats() []*DiskIOStats
- func (s *Stat) FSInfos() []*FSInfos
- func (s *Stat) HostInfos() *HostInfos
- func (s *Stat) InteraceInfos() []*InterfaceInfos
- func (s *Stat) MemStats() *MemStats
- func (s *Stat) NetIOStats() []*NetIOStats
- func (s *Stat) PageStats() *PageStats
- func (s *Stat) ProcessStats() *ProcessStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUStats ¶
type CPUStats struct { User float64 Kernel float64 Idle float64 IOWait float64 Swap float64 Nice float64 // System load averages LoadMin1 float64 LoadMin5 float64 LoadMin15 float64 // The time taken in seconds since the last call of the function Period time.Duration TimeTaken time.Time }
CPUStats contains cpu stats Delivers correlated relative cpu counters (where total is 100%)
type DiskIOStats ¶
type DiskIOStats struct { DiskName string ReadBytes int WriteBytes int // The time period over which read_bytes and write_bytes were transferred. Period time.Duration TimeTaken time.Time }
DiskIOStats contains disk io stats Expressed in bytes
func (*DiskIOStats) String ¶
func (d *DiskIOStats) String() string
type FSInfos ¶
type FSInfos struct { DeviceName string FSType string MountPoint string // Size, Used, Free, Available are expressed in bytes Size int Used int Free int Available int // Inodes count TotalInodes int UsedInodes int FreeInodes int AvailableInodes int }
FSInfos contains filesystem & mountpoints informations
type HostInfos ¶
type HostInfos struct { OSName string OSRelease string OSVersion string Platform string HostName string NCPUs int MaxCPUs int BitWidth int //32, 64 bits // contains filtered or unexported fields }
HostInfos contains informations related to the system
type InterfaceDuplexType ¶
type InterfaceDuplexType int
InterfaceDuplexType network interface duplex type
const ( InterfaceFullDuplex InterfaceDuplexType = iota InterfaceHalfDuplex InterfaceUnknownDuplex )
func (InterfaceDuplexType) MarshalText ¶
func (s InterfaceDuplexType) MarshalText() ([]byte, error)
func (InterfaceDuplexType) String ¶
func (s InterfaceDuplexType) String() string
func (*InterfaceDuplexType) UnmarshalText ¶
func (s *InterfaceDuplexType) UnmarshalText(text []byte) error
type InterfaceInfos ¶
type InterfaceInfos struct { Name string // Speed in factor/sec Speed int Factor int Duplex InterfaceDuplexType State InterfaceState }
InterfaceInfos network interface related infos
func (*InterfaceInfos) String ¶
func (i *InterfaceInfos) String() string
type InterfaceState ¶
type InterfaceState int
InterfaceState up or down
const ( InterfaceUpState InterfaceState = iota InterfaceDownState )
func (InterfaceState) MarshalText ¶
func (s InterfaceState) MarshalText() ([]byte, error)
func (InterfaceState) String ¶
func (s InterfaceState) String() string
func (*InterfaceState) UnmarshalText ¶
func (s *InterfaceState) UnmarshalText(text []byte) error
type MemStats ¶
type MemStats struct { // The total amount of real memory in bytes Total int // Theount of real memory in bytes. Free int // The used amount of real memory in bytes Used int // The amount of real memory in bytes used for caching Cache int // The total swap space in bytes. SwapTotal int // The used swap in bytes SwapUsed int // The free swap in bytes SwapFree int }
MemStats contains memory & swap stats expressed in bytes
type NetIOStats ¶
type NetIOStats struct { IntName string // Number of bytes transmitted TX int // Number of bytes received RX int // Number of packets received IPackets int // Number of packets transmitted OPackets int // Number of receive errors IErrors int // Number of transmit errors OErrors int // Number of collisions count Collisions int // the time period over which tx and rx were transferred Period time.Duration TimeTaken time.Time }
NetIOStats contains network interfaces stats
func (*NetIOStats) String ¶
func (n *NetIOStats) String() string
type PageStats ¶
type PageStats struct { // The number of pages swapped into memory. PageIn int // The number of pages swapped out of memory (to swap). PageOut int // The time period over which pages_pagein and pages_pageout weretransferred. Period time.Duration TimeTaken time.Time }
PageStats contains pages stats
type ProcessStats ¶
type ProcessStats struct { // The total number of processes Total int // The number of running processes Running int // The number of sleeping processes Sleeping int // The number of stopped processes Stopped int // The number of zombie processes Zombie int }
ProcessStats contains processes count stats
func (*ProcessStats) String ¶
func (p *ProcessStats) String() string
type Stat ¶
Stat handle to access libstatgrab
func (*Stat) CPUStats ¶
CPUStats get cpu related stats note that 1st call to 100ms may return NaN as values Go equivalent to sg_cpu_percents
func (*Stat) DiskIOStats ¶
func (s *Stat) DiskIOStats() []*DiskIOStats
DiskIOStats get I/Os related stats note that 1st call to 100ms may return NaN as values Go equivalent to sg_disk_io_stats
func (*Stat) FSInfos ¶
FSInfos return an FSInfo struct per mounted filesystem Go equivalent to sg_get_fs_stats
func (*Stat) InteraceInfos ¶
func (s *Stat) InteraceInfos() []*InterfaceInfos
func (*Stat) MemStats ¶
MemStats get memory & swap related stats Go equivalent to sg_get_mem_stats & sg_get_swap_stats
func (*Stat) NetIOStats ¶
func (s *Stat) NetIOStats() []*NetIOStats
NetIOStats get interface ios related stats Go equivalent to sg_get_network_io_stats
func (*Stat) ProcessStats ¶
func (s *Stat) ProcessStats() *ProcessStats
ProcessStats get prceosses related stats note that 1st call to 100ms may return NaN as values Go equivalent to sg_cpu_percents