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

Method SysctlStrings

proc_sys.go:27–34  ·  view source on GitHub ↗
(sysctl string)

Source from the content-addressed store, hash-verified

25}
26
27func (fs FS) SysctlStrings(sysctl string) ([]string, error) {
28 value, err := util.SysReadFile(fs.proc.Path("sys", sysctlToPath(sysctl)))
29 if err != nil {
30 return nil, err
31 }
32 return strings.Fields(value), nil
33
34}
35
36func (fs FS) SysctlInts(sysctl string) ([]int, error) {
37 fields, err := fs.SysctlStrings(sysctl)

Callers 2

SysctlIntsMethod · 0.95
TestSysctlStringsFunction · 0.80

Calls 3

SysReadFileFunction · 0.92
sysctlToPathFunction · 0.85
PathMethod · 0.45

Tested by 1

TestSysctlStringsFunction · 0.64