Documentation ¶
Index ¶
- Constants
- func PidExists(pid int32) (bool, error)
- func Pids() ([]int32, error)
- type IOCountersStat
- type MemoryInfoExStat
- type MemoryInfoStat
- type MemoryMapsStat
- type NumCtxSwitchesStat
- type OpenFilesStat
- type Process
- func (p *Process) CPUAffinity() ([]int32, error)
- func (p *Process) CPUPercent() (int32, error)
- func (p *Process) CPUTimes() (*cpu.CPUTimesStat, error)
- func (p *Process) Children() ([]*Process, error)
- func (p *Process) Cmdline() (string, error)
- func (p *Process) Connections() ([]net.NetConnectionStat, error)
- func (p *Process) CreateTime() (int64, error)
- func (p *Process) Cwd() (string, error)
- func (p *Process) Exe() (string, error)
- func (p *Process) Gids() ([]int32, error)
- func (p *Process) IOCounters() (*IOCountersStat, error)
- func (p *Process) IOnice() (int32, error)
- func (p *Process) IsRunning() (bool, error)
- func (p *Process) Kill() error
- func (p *Process) MemoryInfo() (*MemoryInfoStat, error)
- func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error)
- func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error)
- func (p *Process) MemoryPercent() (float32, error)
- func (p *Process) Name() (string, error)
- func (p *Process) Nice() (int32, error)
- func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error)
- func (p *Process) NumFDs() (int32, error)
- func (p *Process) NumThreads() (int32, error)
- func (p *Process) OpenFiles() ([]OpenFilesStat, error)
- func (p *Process) Parent() (*Process, error)
- func (p *Process) Ppid() (int32, error)
- func (p *Process) Resume() error
- func (p *Process) Rlimit() ([]RlimitStat, error)
- func (p *Process) SendSignal(sig syscall.Signal) error
- func (p *Process) Status() (string, error)
- func (p Process) String() string
- func (p *Process) Suspend() error
- func (p *Process) Terminal() (string, error)
- func (p *Process) Terminate() error
- func (p *Process) Threads() (map[string]string, error)
- func (p *Process) Uids() ([]int32, error)
- func (p *Process) Username() (string, error)
- type RlimitStat
Constants ¶
View Source
const ( ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) )
View Source
const (
PrioProcess = 0 // linux/resource.h
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IOCountersStat ¶
type IOCountersStat struct { ReadCount uint64 `json:"read_count"` WriteCount uint64 `json:"write_count"` ReadBytes uint64 `json:"read_bytes"` WriteBytes uint64 `json:"write_bytes"` }
func (IOCountersStat) String ¶
func (i IOCountersStat) String() string
type MemoryInfoExStat ¶
type MemoryInfoExStat struct { RSS uint64 `json:"rss"` // bytes VMS uint64 `json:"vms"` // bytes Text uint64 `json:"text"` // bytes Lib uint64 `json:"lib"` // bytes Data uint64 `json:"data"` // bytes Dirty uint64 `json:"dirty"` // bytes }
MemoryInfoExStat is different between OSes
func (MemoryInfoExStat) String ¶
func (m MemoryInfoExStat) 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 MemoryMapsStat ¶
type MemoryMapsStat struct { Path string `json:"path"` Rss uint64 `json:"rss"` Size uint64 `json:"size"` Pss uint64 `json:"pss"` PrivateClean uint64 `json:"private_clean"` PrivateDirty uint64 `json:"private_dirty"` Referenced uint64 `json:"referenced"` Anonymous uint64 `json:"anonymous"` Swap uint64 `json:"swap"` }
func (MemoryMapsStat) String ¶
func (m MemoryMapsStat) 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 NewProcess ¶
Create new Process instance This only stores Pid
func (*Process) CPUAffinity ¶
func (*Process) CPUPercent ¶
func (*Process) Connections ¶
func (p *Process) Connections() ([]net.NetConnectionStat, error)
func (*Process) CreateTime ¶
func (*Process) IOCounters ¶
func (p *Process) IOCounters() (*IOCountersStat, error)
func (*Process) MemoryInfo ¶
func (p *Process) MemoryInfo() (*MemoryInfoStat, error)
func (*Process) MemoryInfoEx ¶
func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error)
func (*Process) MemoryMaps ¶
func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error)
MemoryMaps get memory maps from /proc/(pid)/smaps
func (*Process) MemoryPercent ¶
func (*Process) NumCtxSwitches ¶
func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error)
func (*Process) NumThreads ¶
func (*Process) OpenFiles ¶
func (p *Process) OpenFiles() ([]OpenFilesStat, error)
func (*Process) Rlimit ¶
func (p *Process) Rlimit() ([]RlimitStat, error)
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.