Documentation
¶
Index ¶
- Constants
- type CpuUsage
- type DarwinProcess
- func (p *DarwinProcess) GetCpuUsage() (CpuUsage, error)
- func (p *DarwinProcess) GetMemoryUsage() (MemoryUsage, error)
- func (p *DarwinProcess) GetName() (string, error)
- func (p *DarwinProcess) GetRss() (int64, error)
- func (p *DarwinProcess) GetRssWithSwap() (int64, error)
- func (p *DarwinProcess) GetStats() (ProcessStats, error)
- func (p *DarwinProcess) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats
- type LinuxProcess
- func (p *LinuxProcess) GetCpuUsage() (CpuUsage, error)
- func (p *LinuxProcess) GetMemoryUsage() (MemoryUsage, error)
- func (p *LinuxProcess) GetName() (string, error)
- func (p *LinuxProcess) GetRss() (int64, error)
- func (p *LinuxProcess) GetRssWithSwap() (int64, error)
- func (p *LinuxProcess) GetStats() (ProcessStats, error)
- func (p *LinuxProcess) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats
- type MemoryUsage
- type Process
- type ProcessState
- type ProcessStats
- type WindowsProcess
- func (p *WindowsProcess) GetChildrenPids() ([]int32, error)
- func (p *WindowsProcess) GetCpuUsage() (CpuUsage, error)
- func (p *WindowsProcess) GetMemoryUsage() (MemoryUsage, error)
- func (p *WindowsProcess) GetName() (string, error)
- func (p *WindowsProcess) GetRss() (int64, error)
- func (p *WindowsProcess) GetRssWithSwap() (int64, error)
- func (p *WindowsProcess) GetStats() (ProcessStats, error)
- func (p *WindowsProcess) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats
Constants ¶
View Source
const ( LinuxProcStatusPath = "/proc/{pid}/status" LinuxProcSmapsPath = "/proc/{pid}/smaps" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DarwinProcess ¶ added in v0.3.2
type DarwinProcess struct {
Pid int32
}
func NewDarwinProcess ¶ added in v0.3.2
func NewDarwinProcess(pid int32) (*DarwinProcess, error)
func (*DarwinProcess) GetCpuUsage ¶ added in v0.3.2
func (p *DarwinProcess) GetCpuUsage() (CpuUsage, error)
func (*DarwinProcess) GetMemoryUsage ¶ added in v0.3.2
func (p *DarwinProcess) GetMemoryUsage() (MemoryUsage, error)
func (*DarwinProcess) GetName ¶ added in v0.3.2
func (p *DarwinProcess) GetName() (string, error)
func (*DarwinProcess) GetRss ¶ added in v0.3.2
func (p *DarwinProcess) GetRss() (int64, error)
func (*DarwinProcess) GetRssWithSwap ¶ added in v0.3.2
func (p *DarwinProcess) GetRssWithSwap() (int64, error)
func (*DarwinProcess) GetStats ¶ added in v0.3.2
func (p *DarwinProcess) GetStats() (ProcessStats, error)
func (*DarwinProcess) WatchStats ¶ added in v0.3.2
func (p *DarwinProcess) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats
type LinuxProcess ¶
type LinuxProcess struct { Pid int32 // contains filtered or unexported fields }
func NewLinuxProcess ¶
func NewLinuxProcess(pid int32) (*LinuxProcess, error)
func (*LinuxProcess) GetCpuUsage ¶
func (p *LinuxProcess) GetCpuUsage() (CpuUsage, error)
func (*LinuxProcess) GetMemoryUsage ¶
func (p *LinuxProcess) GetMemoryUsage() (MemoryUsage, error)
func (*LinuxProcess) GetName ¶
func (p *LinuxProcess) GetName() (string, error)
func (*LinuxProcess) GetRss ¶
func (p *LinuxProcess) GetRss() (int64, error)
GetRss returns the current memory usage in kilobytes of the process. This is calculated from the total RSS from all the libraries and itself that the process uses. RSS includes heap and stack memory, but not swap memory.
func (*LinuxProcess) GetRssWithSwap ¶
func (p *LinuxProcess) GetRssWithSwap() (int64, error)
GetRssWithSwap returns the current memory usage in kilobytes of the process. This is calculated from the total memory from all the libraries and itself that the process uses.
func (*LinuxProcess) GetStats ¶
func (p *LinuxProcess) GetStats() (ProcessStats, error)
func (*LinuxProcess) WatchStats ¶
func (p *LinuxProcess) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats
type MemoryUsage ¶
type Process ¶
type Process interface { GetName() (string, error) GetStats() (ProcessStats, error) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats GetCpuUsage() (CpuUsage, error) GetMemoryUsage() (MemoryUsage, error) GetRss() (int64, error) GetRssWithSwap() (int64, error) }
func NewProcess ¶
type ProcessState ¶
type ProcessState string
const ( ProcessStateSleeping ProcessState = "S" ProcessStateRunning ProcessState = "R" ProcessStateZombie ProcessState = "Z" ProcessStateUninterruptibleWait ProcessState = "D" )
type ProcessStats ¶
type ProcessStats struct { CpuUsage CpuUsage `json:"cpuUsage"` MemoryUsage MemoryUsage `json:"memoryUsage"` Timestamp time.Time `json:"timestamp"` }
type WindowsProcess ¶ added in v0.3.2
type WindowsProcess struct {
Pid int32
}
func NewWindowsProcess ¶ added in v0.3.2
func NewWindowsProcess(pid int32) (*WindowsProcess, error)
func (*WindowsProcess) GetChildrenPids ¶ added in v0.3.2
func (p *WindowsProcess) GetChildrenPids() ([]int32, error)
func (*WindowsProcess) GetCpuUsage ¶ added in v0.3.2
func (p *WindowsProcess) GetCpuUsage() (CpuUsage, error)
func (*WindowsProcess) GetMemoryUsage ¶ added in v0.3.2
func (p *WindowsProcess) GetMemoryUsage() (MemoryUsage, error)
func (*WindowsProcess) GetName ¶ added in v0.3.2
func (p *WindowsProcess) GetName() (string, error)
func (*WindowsProcess) GetRss ¶ added in v0.3.2
func (p *WindowsProcess) GetRss() (int64, error)
func (*WindowsProcess) GetRssWithSwap ¶ added in v0.3.2
func (p *WindowsProcess) GetRssWithSwap() (int64, error)
func (*WindowsProcess) GetStats ¶ added in v0.3.2
func (p *WindowsProcess) GetStats() (ProcessStats, error)
func (*WindowsProcess) WatchStats ¶ added in v0.3.2
func (p *WindowsProcess) WatchStats(ctx context.Context, interval time.Duration) <-chan ProcessStats
Click to show internal directories.
Click to hide internal directories.