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

Function parseSoftIRQStat

stat.go:127–144  ·  view source on GitHub ↗

Parse a softirq line.

(line string)

Source from the content-addressed store, hash-verified

125
126// Parse a softirq line.
127func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) {
128 softIRQStat := SoftIRQStat{}
129 var total uint64
130 var prefix string
131
132 _, err := fmt.Sscanf(line, "%s %d %d %d %d %d %d %d %d %d %d %d",
133 &prefix, &total,
134 &softIRQStat.Hi, &softIRQStat.Timer, &softIRQStat.NetTx, &softIRQStat.NetRx,
135 &softIRQStat.Block, &softIRQStat.BlockIoPoll,
136 &softIRQStat.Tasklet, &softIRQStat.Sched,
137 &softIRQStat.Hrtimer, &softIRQStat.Rcu)
138
139 if err != nil {
140 return SoftIRQStat{}, 0, fmt.Errorf("%w: couldn't parse %q (softirq): %w", ErrFileParse, line, err)
141 }
142
143 return softIRQStat, total, nil
144}
145
146// NewStat returns information about current cpu/process statistics.
147// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt

Callers 1

parseStatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…