Documentation ¶
Index ¶
- func Pids() ([]int, error)
- func StateString(state string) string
- type Cmdline
- type Process
- type ProcessList
- type ProcessMap
- type ProcessStat
- type ProcessTable
- func (self *ProcessTable) Add(pid int) error
- func (self *ProcessTable) Clone() (*ProcessTable, error)
- func (self *ProcessTable) Delete(pid int)
- func (self *ProcessTable) Get(pid int) (*Process, error)
- func (self *ProcessTable) GetOrDefault(pid int) *Process
- func (self *ProcessTable) Sync() error
- func (self *ProcessTable) Update(pid int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StateString ¶
Types ¶
type Cmdline ¶
type Cmdline struct {
// contains filtered or unexported fields
}
read from /proc/[pid]/cmdline
func NewCmdlineByPid ¶
func NewCommByPid ¶
func (*Cmdline) CombinedString ¶
func (*Cmdline) ShortString ¶
type Process ¶
type Process struct { Pid int Cmdline *Cmdline Stat *ProcessStat TimeStamp time.Time KernelThread bool }
func NewProcess ¶
type ProcessList ¶
type ProcessList []*Process
type ProcessMap ¶
func Processes ¶
func Processes() (ProcessMap, error)
type ProcessStat ¶
type ProcessStat struct { Pid int //0 Comm string //1 State string //2 PPid int //3 UserTime uint64 //13, device by sysconf(_SC_CLK_TCK) SystemTime uint64 //14, device by sysconf(_SC_CLK_TCK) ChildUserTime uint64 //15, device by sysconf(_SC_CLK_TCK) ChildSystemTime uint64 //16, device by sysconf(_SC_CLK_TCK) Threads int //19 StartTime uint64 //21, device by sysconf(_SC_CLK_TCK) VmSize uint64 //22 VmRSS uint64 //23 DelayAcctBlkioTicks uint64 //41, delayacct_blkio_ticks, device by sysconf(_SC_CLK_TCK) }
read from /proc/[pid]/stat
func NewProcessStat ¶
func NewProcessStat(reader io.Reader) (*ProcessStat, error)
func NewProcessStatByPid ¶
func NewProcessStatByPid(pid int) (*ProcessStat, error)
func (*ProcessStat) Equal ¶
func (self *ProcessStat) Equal(other *ProcessStat) bool
func (*ProcessStat) StateString ¶
func (self *ProcessStat) StateString() string
func (*ProcessStat) TotalCputime ¶
func (self *ProcessStat) TotalCputime() uint64
type ProcessTable ¶
func NewProcessTable ¶
func NewProcessTable() (*ProcessTable, error)
func (*ProcessTable) Add ¶
func (self *ProcessTable) Add(pid int) error
func (*ProcessTable) Clone ¶
func (self *ProcessTable) Clone() (*ProcessTable, error)
func (*ProcessTable) Delete ¶
func (self *ProcessTable) Delete(pid int)
func (*ProcessTable) GetOrDefault ¶
func (self *ProcessTable) GetOrDefault(pid int) *Process
func (*ProcessTable) Update ¶
func (self *ProcessTable) Update(pid int) error
동일한 프로세스가 이미 존재할 경우에만 update 를 수행한다.
Click to show internal directories.
Click to hide internal directories.