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

Method readFilesystemStats

btrfs/get.go:224–255  ·  view source on GitHub ↗

readFilesystemStats reads Btrfs statistics for a filesystem.

()

Source from the content-addressed store, hash-verified

222
223// readFilesystemStats reads Btrfs statistics for a filesystem.
224func (r *reader) readFilesystemStats() (s *Stats) {
225 // First get disk info, and add it to reader
226 devices := r.readDeviceInfo("devices")
227 r.devCount = len(devices)
228
229 s = &Stats{
230 // Read basic filesystem information
231 Label: r.readFile("label"),
232 UUID: r.readFile("metadata_uuid"),
233 Features: r.listFiles("features"),
234 CloneAlignment: r.readValue("clone_alignment"),
235 NodeSize: r.readValue("nodesize"),
236 QuotaOverride: r.readValue("quota_override"),
237 SectorSize: r.readValue("sectorsize"),
238
239 // Device info
240 Devices: devices,
241
242 // Read allocation data
243 Allocation: Allocation{
244 GlobalRsvReserved: r.readValue("allocation/global_rsv_reserved"),
245 GlobalRsvSize: r.readValue("allocation/global_rsv_size"),
246 Data: r.readAllocationStats("allocation/data"),
247 Metadata: r.readAllocationStats("allocation/metadata"),
248 System: r.readAllocationStats("allocation/system"),
249 },
250
251 // Read commit stats data
252 CommitStats: r.readCommitStats("commit_stats"),
253 }
254 return
255}
256
257// readCommitStats returns the commit_stats information for commit stats metrics.
258func (r *reader) readCommitStats(p string) CommitStats {

Callers 1

GetStatsFunction · 0.95

Calls 6

readDeviceInfoMethod · 0.95
readFileMethod · 0.95
listFilesMethod · 0.95
readValueMethod · 0.95
readAllocationStatsMethod · 0.95
readCommitStatsMethod · 0.95

Tested by

no test coverage detected