MCPcopy Create free account
hub / github.com/prometheus/procfs / Cgroups

Method Cgroups

proc_cgroup.go:92–98  ·  view source on GitHub ↗

Cgroups reads from /proc/ /cgroups and returns a []*Cgroup struct locating this PID in each process control hierarchy running on this system. On every system (v1 and v2), all hierarchies contain all processes, so the len of the returned struct is equal to the number of active hierarchies on this

()

Source from the content-addressed store, hash-verified

90// control hierarchy running on this system. On every system (v1 and v2), all hierarchies contain all processes,
91// so the len of the returned struct is equal to the number of active hierarchies on this system.
92func (p Proc) Cgroups() ([]Cgroup, error) {
93 data, err := parsers.ReadFileNoStat(p.path("cgroup"))
94 if err != nil {
95 return nil, err
96 }
97 return parseCgroups(data)
98}

Callers

nothing calls this directly

Calls 3

pathMethod · 0.95
ReadFileNoStatFunction · 0.92
parseCgroupsFunction · 0.85

Tested by

no test coverage detected