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

Function extentAllocationStats

xfs/parse.go:199–210  ·  view source on GitHub ↗

extentAllocationStats builds an ExtentAllocationStats from a slice of uint32s.

(us []uint32)

Source from the content-addressed store, hash-verified

197
198// extentAllocationStats builds an ExtentAllocationStats from a slice of uint32s.
199func extentAllocationStats(us []uint32) (ExtentAllocationStats, error) {
200 if l := len(us); l != 4 {
201 return ExtentAllocationStats{}, fmt.Errorf("incorrect number of values for XFS extent allocation stats: %d", l)
202 }
203
204 return ExtentAllocationStats{
205 ExtentsAllocated: us[0],
206 BlocksAllocated: us[1],
207 ExtentsFreed: us[2],
208 BlocksFreed: us[3],
209 }, nil
210}
211
212// btreeStats builds a BTreeStats from a slice of uint32s.
213func btreeStats(us []uint32) (BTreeStats, error) {

Callers 1

ParseStatsFunction · 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…