Documentation ¶
Overview ¶
build +linux
Index ¶
- Constants
- func GetCgroup(pid int) (cgroup string, err error)
- func GetOomScoreAdj(pid int) (score int, err error)
- func GetUid(pid int) int
- func GetUser(pid int) (*user.User, error)
- func IOPrio_Get(pid int) (int, error)
- func IOPrio_Split(ioprio int, class, data *int)
- func Sched_GetParam(pid int) (int, error)
- func Sched_GetScheduler(pid int) (int, error)
- func Stat(stat string) string
- type ByPid
- type Filter
- type Formatter
- type MainProperties
- type Proc
- func (p *Proc) CPUSchedInfo() string
- func (p *Proc) IOClass() string
- func (p *Proc) IOSchedInfo() string
- func (p *Proc) InSystemSlice() bool
- func (p *Proc) InUserSlice() bool
- func (p *Proc) Json() string
- func (p *Proc) LoadStat() (err error)
- func (p *Proc) Map() map[string]interface{}
- func (p *Proc) Raw() string
- func (p *Proc) ReadStat(stat string) (err error)
- func (p *Proc) RuntimeProperties() map[string]interface{}
- func (p *Proc) Sched() string
- func (p *Proc) String() string
- func (p *Proc) Values() string
- type ProcMap
- type Sched_Param
- type SchedulingPolicy
Constants ¶
View Source
const ( IOPRIO_CLASS_NONE = iota IOPRIO_CLASS_RT IOPRIO_CLASS_BE IOPRIO_CLASS_IDLE )
View Source
const ( IOPRIO_WHO_PROCESS IOPRIO_WHO_PGRP IOPRIO_WHO_USER )
View Source
const ( NONE = iota REALTIME BEST_EFFORT IDLE )
View Source
const ( SCHED_OTHER = iota SCHED_FIFO SCHED_RR SCHED_BATCH SCHED_ISO SCHED_IDLE SCHED_DEADLINE )
View Source
const IOPRIO_CLASS_SHIFT = 13
Variables ¶
This section is empty.
Functions ¶
func GetOomScoreAdj ¶
func IOPrio_Get ¶
func IOPrio_Split ¶
func Sched_GetParam ¶
func Sched_GetScheduler ¶
Types ¶
type Formatter ¶
func GetFormatter ¶
type MainProperties ¶
type Proc ¶
type Proc struct { Pid int `json:"pid"` Ppid int `json:"ppid"` Pgrp int `json:"pgrp"` Uid int `json:"uid"` User string `json:"user"` State string `json:"state"` Comm string `json:"comm"` Cgroup string `json:"cgroup"` Priority int `json:"priority"` Nice int `json:"nice"` NumThreads int `json:"num_threads"` RTPrio int `json:"rtprio"` Policy int `json:"policy"` OomScoreAdj int `json:"oom_score_adj"` IOPrioClass int `json:"ioprio_class"` IOPrioData int `json:"ionice"` }
func AllProcs ¶
AllProcs returns a list of all currently available processes. Filters result with filterFunc, if not nil.
func GetCalling ¶
func GetCalling() *Proc
func NewProcFromStat ¶
func (*Proc) CPUSchedInfo ¶
func (*Proc) IOSchedInfo ¶
func (*Proc) InSystemSlice ¶
func (*Proc) InUserSlice ¶
func (*Proc) RuntimeProperties ¶
type ProcMap ¶
type ProcMap struct { Pid int `json:"pid"` Ppid int `json:"ppid"` Pgrp int `json:"pgrp"` Uid int `json:"uid"` User string `json:"user"` State string `json:"state"` Slice string `json:"slice"` Unit string `json:"unit"` Comm string `json:"comm"` Cgroup string `json:"cgroup"` Priority int `json:"priority"` NumThreads int `json:"num_threads"` Runtime MainProperties `json:"runtime"` }
func NewProcMap ¶
type Sched_Param ¶
type Sched_Param struct {
Sched_Priority int
}
type SchedulingPolicy ¶
type SchedulingPolicy struct { Class map[int]string NeedPriority []int NeedCredentials []int Low int High int None int }
var CPU SchedulingPolicy = SchedulingPolicy{ Class: map[int]string{ 0: "SCHED_OTHER", 1: "SCHED_FIFO", 2: "SCHED_RR", 3: "SCHED_BATCH", 5: "SCHED_IDLE", 6: "SCHED_DEADLINE", }, NeedPriority: []int{1, 2}, NeedCredentials: []int{1, 2}, Low: 1, High: 99, None: 0, }
var IO SchedulingPolicy = SchedulingPolicy{ Class: map[int]string{ 0: "none", 1: "realtime", 2: "best-effort", 3: "idle", }, NeedPriority: []int{1, 2}, NeedCredentials: []int{1}, Low: 7, High: 0, None: 4, }
Click to show internal directories.
Click to hide internal directories.