package sigar
import "github.com/cloudfoundry/gosigar"
Index ¶
- Constants
- Variables
- func FormatPercent(percent float64) string
- func FormatSize(size uint64) string
- type ConcreteSigar
- func (c *ConcreteSigar) CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{})
- func (c *ConcreteSigar) GetFileSystemUsage(path string) (FileSystemUsage, error)
- func (c *ConcreteSigar) GetLoadAverage() (LoadAverage, error)
- func (c *ConcreteSigar) GetMem() (Mem, error)
- func (c *ConcreteSigar) GetMemIgnoringCGroups() (Mem, error)
- func (c *ConcreteSigar) GetSwap() (Swap, error)
- type Cpu
- type CpuList
- type FileSystem
- type FileSystemList
- type FileSystemUsage
- type LoadAverage
- type Mem
- type ProcArgs
- type ProcCpu
- type ProcExe
- type ProcList
- type ProcMem
- type ProcState
- type ProcTime
- type RunState
- type Sigar
- type Swap
- type Uptime
Constants ¶
const ( RunStateSleep = 'S' RunStateRun = 'R' RunStateStop = 'T' RunStateZombie = 'Z' RunStateIdle = 'D' RunStateUnknown = '?' )
Variables ¶
Functions ¶
func FormatPercent ¶
func FormatSize ¶
Go version of apr_strfsize
Types ¶
type ConcreteSigar ¶
type ConcreteSigar struct{}
func (*ConcreteSigar) CollectCpuStats ¶
func (c *ConcreteSigar) CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{})
func (*ConcreteSigar) GetFileSystemUsage ¶
func (c *ConcreteSigar) GetFileSystemUsage(path string) (FileSystemUsage, error)
func (*ConcreteSigar) GetLoadAverage ¶
func (c *ConcreteSigar) GetLoadAverage() (LoadAverage, error)
func (*ConcreteSigar) GetMem ¶
func (c *ConcreteSigar) GetMem() (Mem, error)
func (*ConcreteSigar) GetMemIgnoringCGroups ¶
func (c *ConcreteSigar) GetMemIgnoringCGroups() (Mem, error)
func (*ConcreteSigar) GetSwap ¶
func (c *ConcreteSigar) GetSwap() (Swap, error)
type Cpu ¶
type Cpu struct { User uint64 Nice uint64 Sys uint64 Idle uint64 Wait uint64 Irq uint64 SoftIrq uint64 Stolen uint64 }
func (Cpu) Delta ¶
func (*Cpu) Total ¶
type CpuList ¶
type CpuList struct { List []Cpu }
type FileSystem ¶
type FileSystem struct { DirName string DevName string TypeName string SysTypeName string Options string Flags uint32 }
type FileSystemList ¶
type FileSystemList struct { List []FileSystem }
type FileSystemUsage ¶
type FileSystemUsage struct { Total uint64 Used uint64 Free uint64 Avail uint64 Files uint64 FreeFiles uint64 }
func (*FileSystemUsage) UsePercent ¶
func (self *FileSystemUsage) UsePercent() float64
type LoadAverage ¶
type LoadAverage struct { One, Five, Fifteen float64 }
type Mem ¶
type ProcArgs ¶
type ProcArgs struct { List []string }
type ProcCpu ¶
type ProcCpu struct { ProcTime LastTime uint64 Percent float64 // contains filtered or unexported fields }
func (*ProcCpu) Get ¶
type ProcExe ¶
type ProcList ¶
type ProcList struct { List []int }
type ProcMem ¶
type ProcMem struct { Size uint64 Resident uint64 uint64 MinorFaults uint64 MajorFaults uint64 PageFaults uint64 }
type ProcState ¶
type ProcState struct { Name string State RunState Ppid int Tty int Priority int Nice int Processor int }
type ProcTime ¶
func (*ProcTime) FormatStartTime ¶
func (*ProcTime) FormatTotal ¶
type RunState ¶
type RunState byte
type Sigar ¶
type Sigar interface { CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{}) GetLoadAverage() (LoadAverage, error) GetMem() (Mem, error) GetMemIgnoringCGroups() (Mem, error) GetSwap() (Swap, error) GetFileSystemUsage(string) (FileSystemUsage, error) }
type Swap ¶
type Uptime ¶
type Uptime struct { Length float64 }
func (*Uptime) Format ¶
Source Files ¶
concrete_sigar.go sigar_format.go sigar_interface.go sigar_shared.go sigar_util.go
Directories ¶
Path | Synopsis |
---|---|
examples | |
fakes | |
fixtures | |
fixtures/memory | |
fixtures/stress | |
sys | |
sys/windows | Package windows contains various Windows system call. |
- Version
- v1.3.92 (latest)
- Published
- May 7, 2025
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 3 days ago –
Tools for package owners.