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

Method readLayout

btrfs/get.go:181–188  ·  view source on GitHub ↗

readLayout reads the Btrfs layout statistics for an allocation layout.

(p string)

Source from the content-addressed store, hash-verified

179
180// readLayout reads the Btrfs layout statistics for an allocation layout.
181func (r *reader) readLayout(p string) (l *LayoutUsage) {
182 l = new(LayoutUsage)
183 l.TotalBytes = r.readValue(path.Join(p, "total_bytes"))
184 l.UsedBytes = r.readValue(path.Join(p, "used_bytes"))
185 l.Ratio = r.calcRatio(p)
186
187 return
188}
189
190// calcRatio returns the calculated ratio for a layout mode.
191func (r *reader) calcRatio(p string) float64 {

Callers 1

readLayoutsMethod · 0.95

Calls 2

readValueMethod · 0.95
calcRatioMethod · 0.95

Tested by

no test coverage detected