Documentation ¶
Index ¶
- Constants
- Variables
- func FormatPercent(percent float64) string
- func FormatSize(size uint64) string
- func IsNotImplemented(err error) bool
- type ConcreteSigar
- func (c *ConcreteSigar) CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{})
- func (c *ConcreteSigar) GetFDUsage() (FDUsage, error)
- func (c *ConcreteSigar) GetFileSystemUsage(path string) (FileSystemUsage, error)
- func (c *ConcreteSigar) GetHugeTLBPages() (HugeTLBPages, error)
- func (c *ConcreteSigar) GetLoadAverage() (LoadAverage, error)
- func (c *ConcreteSigar) GetMem() (Mem, error)
- func (c *ConcreteSigar) GetRusage(who int) (Rusage, error)
- func (c *ConcreteSigar) GetSwap() (Swap, error)
- type Cpu
- type CpuList
- type ErrNotImplemented
- type FDUsage
- type FileSystem
- type FileSystemList
- type FileSystemUsage
- type HugeTLBPages
- type LoadAverage
- type Mem
- type ProcArgs
- type ProcEnv
- type ProcExe
- type ProcFDUsage
- type ProcList
- type ProcMem
- type ProcState
- type ProcTime
- type RunState
- type Rusage
- type Sigar
- type Swap
- type Uptime
Constants ¶
View Source
const ( RunStateSleep = 'S' RunStateRun = 'R' RunStateStop = 'T' RunStateZombie = 'Z' RunStateIdle = 'D' RunStateUnknown = '?' )
Variables ¶
View Source
var Procd string
Functions ¶
func FormatPercent ¶
func IsNotImplemented ¶
Types ¶
type ConcreteSigar ¶
type ConcreteSigar struct{}
func (*ConcreteSigar) CollectCpuStats ¶
func (c *ConcreteSigar) CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{})
func (*ConcreteSigar) GetFDUsage ¶
func (c *ConcreteSigar) GetFDUsage() (FDUsage, error)
func (*ConcreteSigar) GetFileSystemUsage ¶
func (c *ConcreteSigar) GetFileSystemUsage(path string) (FileSystemUsage, error)
func (*ConcreteSigar) GetHugeTLBPages ¶
func (c *ConcreteSigar) GetHugeTLBPages() (HugeTLBPages, error)
func (*ConcreteSigar) GetLoadAverage ¶
func (c *ConcreteSigar) GetLoadAverage() (LoadAverage, error)
func (*ConcreteSigar) GetMem ¶
func (c *ConcreteSigar) GetMem() (Mem, error)
func (*ConcreteSigar) GetRusage ¶
func (c *ConcreteSigar) GetRusage(who int) (Rusage, error)
GetRusage return the resource usage of the process Possible params: 0 = RUSAGE_SELF, 1 = RUSAGE_CHILDREN, 2 = RUSAGE_THREAD
func (*ConcreteSigar) GetSwap ¶
func (c *ConcreteSigar) GetSwap() (Swap, error)
type Cpu ¶
type ErrNotImplemented ¶
type ErrNotImplemented struct {
OS string
}
func (ErrNotImplemented) Error ¶
func (e ErrNotImplemented) Error() string
type FileSystem ¶
type FileSystemList ¶
type FileSystemList struct {
List []FileSystem
}
func (*FileSystemList) Get ¶
func (self *FileSystemList) Get() error
type FileSystemUsage ¶
type FileSystemUsage struct { Total uint64 Used uint64 Free uint64 Avail uint64 Files uint64 FreeFiles uint64 }
func (*FileSystemUsage) Get ¶
func (self *FileSystemUsage) Get(path string) error
func (*FileSystemUsage) UsePercent ¶
func (self *FileSystemUsage) UsePercent() float64
type HugeTLBPages ¶
type HugeTLBPages struct { Total uint64 Free uint64 Reserved uint64 Surplus uint64 DefaultSize uint64 TotalAllocatedSize uint64 }
func (*HugeTLBPages) Get ¶
func (self *HugeTLBPages) Get() error
type LoadAverage ¶
type LoadAverage struct {
One, Five, Fifteen float64
}
func (*LoadAverage) Get ¶
func (self *LoadAverage) Get() error
type ProcFDUsage ¶
func (*ProcFDUsage) Get ¶
func (self *ProcFDUsage) Get(pid int) error
type ProcMem ¶
type ProcState ¶
type Rusage ¶
type Sigar ¶
type Sigar interface { CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{}) GetLoadAverage() (LoadAverage, error) GetMem() (Mem, error) GetSwap() (Swap, error) GetHugeTLBPages(HugeTLBPages, error) GetFileSystemUsage(string) (FileSystemUsage, error) GetFDUsage() (FDUsage, error) GetRusage(who int) (Rusage, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.