MCPcopy Create free account
hub / github.com/koding/kite / diskStats

Function diskStats

systeminfo/systeminfo_openbsd.go:8–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6)
7
8func diskStats() (*disk, error) {
9 d := new(disk)
10 stat := new(syscall.Statfs_t)
11
12 if err := syscall.Statfs("/", stat); err != nil {
13 return nil, err
14 }
15
16 bsize := uint64(stat.F_bsize) / 512
17
18 d.Total = (uint64(stat.F_blocks) * bsize) >> 1
19 free := (uint64(stat.F_bfree) * bsize) >> 1
20 d.Usage = d.Total - free
21
22 return d, nil
23}
24
25func memoryStats() (*memory, error) {
26 m := new(memory)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected