2014-12-30 22:09:05 +09:00
|
|
|
package disk
|
2014-04-18 16:34:47 +09:00
|
|
|
|
2014-05-01 18:43:11 +09:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
2016-03-22 23:09:12 +09:00
|
|
|
type UsageStat struct {
|
2014-08-26 22:17:35 +09:00
|
|
|
Path string `json:"path"`
|
2015-08-14 18:08:43 +09:00
|
|
|
Fstype string `json:"fstype"`
|
2014-08-26 22:17:35 +09:00
|
|
|
Total uint64 `json:"total"`
|
|
|
|
Free uint64 `json:"free"`
|
|
|
|
Used uint64 `json:"used"`
|
2016-03-23 10:52:46 +09:00
|
|
|
UsedPercent float64 `json:"usedPercent"`
|
|
|
|
InodesTotal uint64 `json:"inodesTotal"`
|
|
|
|
InodesUsed uint64 `json:"inodesUsed"`
|
|
|
|
InodesFree uint64 `json:"inodesFree"`
|
|
|
|
InodesUsedPercent float64 `json:"inodesUsedPercent"`
|
2014-04-18 16:34:47 +09:00
|
|
|
}
|
|
|
|
|
2016-03-22 23:09:12 +09:00
|
|
|
type PartitionStat struct {
|
2014-04-20 01:53:34 +09:00
|
|
|
Device string `json:"device"`
|
|
|
|
Mountpoint string `json:"mountpoint"`
|
|
|
|
Fstype string `json:"fstype"`
|
|
|
|
Opts string `json:"opts"`
|
|
|
|
}
|
|
|
|
|
2016-03-22 23:09:12 +09:00
|
|
|
type IOCountersStat struct {
|
2016-03-23 10:52:46 +09:00
|
|
|
ReadCount uint64 `json:"readCount"`
|
|
|
|
WriteCount uint64 `json:"writeCount"`
|
|
|
|
ReadBytes uint64 `json:"readBytes"`
|
|
|
|
WriteBytes uint64 `json:"writeBytes"`
|
|
|
|
ReadTime uint64 `json:"readTime"`
|
|
|
|
WriteTime uint64 `json:"writeTime"`
|
2014-09-22 16:35:47 +09:00
|
|
|
Name string `json:"name"`
|
2016-03-23 10:52:46 +09:00
|
|
|
IoTime uint64 `json:"ioTime"`
|
|
|
|
SerialNumber string `json:"serialNumber"`
|
2014-04-18 16:34:47 +09:00
|
|
|
}
|
2014-05-01 18:43:11 +09:00
|
|
|
|
2016-03-22 23:09:12 +09:00
|
|
|
func (d UsageStat) String() string {
|
2014-05-01 18:43:11 +09:00
|
|
|
s, _ := json.Marshal(d)
|
|
|
|
return string(s)
|
|
|
|
}
|
|
|
|
|
2016-03-22 23:09:12 +09:00
|
|
|
func (d PartitionStat) String() string {
|
2014-05-01 18:43:11 +09:00
|
|
|
s, _ := json.Marshal(d)
|
|
|
|
return string(s)
|
|
|
|
}
|
|
|
|
|
2016-03-22 23:09:12 +09:00
|
|
|
func (d IOCountersStat) String() string {
|
2014-05-01 18:43:11 +09:00
|
|
|
s, _ := json.Marshal(d)
|
|
|
|
return string(s)
|
|
|
|
}
|