MCPcopy Create free account
hub / github.com/containerd/cgroups / readKVStatsFile

Function readKVStatsFile

cgroup2/manager.go:729–745  ·  view source on GitHub ↗
(path string, file string, out map[string]uint64)

Source from the content-addressed store, hash-verified

727}
728
729func readKVStatsFile(path string, file string, out map[string]uint64) error {
730 f, err := os.Open(filepath.Join(path, file))
731 if err != nil {
732 return err
733 }
734 defer f.Close()
735
736 s := bufio.NewScanner(f)
737 for s.Scan() {
738 name, value, err := parseKV(s.Text())
739 if err != nil {
740 return fmt.Errorf("error while parsing %s (line=%q): %w", filepath.Join(path, file), s.Text(), err)
741 }
742 out[name] = value
743 }
744 return s.Err()
745}
746
747func (c *Manager) Freeze() error {
748 return c.freeze(c.path, Frozen)

Callers 5

readCPUStatsFunction · 0.85
readMemoryStatsFunction · 0.85
readMemoryEventsFunction · 0.85
isCgroupEmptyMethod · 0.85
EventChanMethod · 0.85

Calls 1

parseKVFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…