MCPcopy Create free account
hub / github.com/bytesizedhosting/bcd / DiskSpace

Method DiskSpace

plugins/stats/stats.go:133–147  ·  view source on GitHub ↗
(args *StatsArgs, res *StatsResponse)

Source from the content-addressed store, hash-verified

131}
132
133func (s *Stats) DiskSpace(args *StatsArgs, res *StatsResponse) error {
134 log.WithFields(log.Fields{
135 "plugin": s.GetName(),
136 "method": "Diskspace",
137 }).Debug("Gathering Diskspace stats")
138
139 if len(args.Mounts) > 0 {
140 for _, m := range args.Mounts {
141 res.Results = append(res.Results, s.diskspaceResult(m))
142 }
143 } else {
144 res.Results = append(res.Results, s.diskspaceResult("/"))
145 }
146 return nil
147}
148
149func (s *Stats) diskspaceResult(mount string) StatsResult {
150 usage := du.NewDiskUsage(mount)

Callers

nothing calls this directly

Calls 2

diskspaceResultMethod · 0.95
GetNameMethod · 0.65

Tested by

no test coverage detected