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

Function parseProcSchedstat

schedstat.go:98–121  ·  view source on GitHub ↗
(contents string)

Source from the content-addressed store, hash-verified

96}
97
98func parseProcSchedstat(contents string) (ProcSchedstat, error) {
99 var (
100 stats ProcSchedstat
101 err error
102 )
103 match := procLineRE.FindStringSubmatch(contents)
104
105 if match != nil {
106 stats.RunningNanoseconds, err = strconv.ParseUint(match[1], 10, 64)
107 if err != nil {
108 return stats, err
109 }
110
111 stats.WaitingNanoseconds, err = strconv.ParseUint(match[2], 10, 64)
112 if err != nil {
113 return stats, err
114 }
115
116 stats.RunTimeslices, err = strconv.ParseUint(match[3], 10, 64)
117 return stats, err
118 }
119
120 return stats, errors.New("could not parse schedstat")
121}

Callers 3

SchedstatMethod · 0.85

Calls

no outgoing calls

Tested by 2