Documentation ¶
Index ¶
- func PidExists(pid int32) (bool, error)
- type IOCountersStat
- type MemoryInfoStat
- type NumCtxSwitchesStat
- type OpenFilesStat
- type Process
- func (p *Process) Kill() error
- func (p *Process) MemoryPercent() (float32, error)
- func (p *Process) Percent(interval time.Duration) (float64, error)
- func (p *Process) Resume() error
- func (p *Process) SendSignal(sig syscall.Signal) error
- func (p Process) String() string
- func (p *Process) Suspend() error
- func (p *Process) Terminate() error
- func (p *Process) Username() (string, error)
- type RlimitStat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IOCountersStat ¶
type IOCountersStat struct { ReadCount uint64 `json:"readCount"` WriteCount uint64 `json:"writeCount"` ReadBytes uint64 `json:"readBytes"` WriteBytes uint64 `json:"writeBytes"` }
func (IOCountersStat) String ¶
func (i IOCountersStat) String() string
type MemoryInfoStat ¶
type MemoryInfoStat struct { RSS uint64 `json:"rss"` // bytes VMS uint64 `json:"vms"` // bytes Swap uint64 `json:"swap"` // bytes }
func (MemoryInfoStat) String ¶
func (m MemoryInfoStat) String() string
type NumCtxSwitchesStat ¶
type NumCtxSwitchesStat struct { Voluntary int64 `json:"voluntary"` Involuntary int64 `json:"involuntary"` }
func (NumCtxSwitchesStat) String ¶
func (p NumCtxSwitchesStat) String() string
type OpenFilesStat ¶
func (OpenFilesStat) String ¶
func (o OpenFilesStat) String() string
type Process ¶
type Process struct { Pid int32 `json:"pid"` // contains filtered or unexported fields }
func (*Process) MemoryPercent ¶
MemoryPercent returns how many percent of the total RAM this process uses
func (*Process) Percent ¶
If interval is 0, return difference from last call(non-blocking). If interval > 0, wait interval sec and return diffrence between start and end.
func (*Process) SendSignal ¶
SendSignal sends a syscall.Signal to the process. Currently, SIGSTOP, SIGCONT, SIGTERM and SIGKILL are supported.
type RlimitStat ¶
type RlimitStat struct { Resource int32 `json:"resource"` Soft int32 `json:"soft"` Hard int32 `json:"hard"` }
func (RlimitStat) String ¶
func (r RlimitStat) String() string
Click to show internal directories.
Click to hide internal directories.