2014-04-22 09:44:22 +09:00
|
|
|
package gopsutil
|
2014-04-18 16:34:47 +09:00
|
|
|
|
2014-05-01 18:43:11 +09:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
2014-04-30 15:32:05 +09:00
|
|
|
type DiskUsageStat struct {
|
2014-08-26 22:17:35 +09:00
|
|
|
Path string `json:"path"`
|
|
|
|
Total uint64 `json:"total"`
|
|
|
|
Free uint64 `json:"free"`
|
|
|
|
Used uint64 `json:"used"`
|
|
|
|
UsedPercent float64 `json:"usedPercent"`
|
|
|
|
InodesTotal uint64 `json:"inodesTotal"`
|
|
|
|
InodesUsed uint64 `json:"inodesUsed"`
|
|
|
|
InodesFree uint64 `json:"inodesFree"`
|
2014-08-26 12:38:52 +04:00
|
|
|
InodesUsedPercent float64 `json:"inodesUsedPercent"`
|
2014-04-18 16:34:47 +09:00
|
|
|
}
|
|
|
|
|
2014-04-30 15:32:05 +09:00
|
|
|
type DiskPartitionStat 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"`
|
|
|
|
}
|
|
|
|
|
2014-04-30 15:32:05 +09:00
|
|
|
type DiskIOCountersStat struct {
|
2014-09-22 16:35:47 +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"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
IoTime uint64 `json:"ioTime"`
|
|
|
|
SerialNumber string `json:"serialNumber"`
|
2014-04-18 16:34:47 +09:00
|
|
|
}
|
2014-05-01 18:43:11 +09:00
|
|
|
|
|
|
|
func (d DiskUsageStat) String() string {
|
|
|
|
s, _ := json.Marshal(d)
|
|
|
|
return string(s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d DiskPartitionStat) String() string {
|
|
|
|
s, _ := json.Marshal(d)
|
|
|
|
return string(s)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d DiskIOCountersStat) String() string {
|
|
|
|
s, _ := json.Marshal(d)
|
|
|
|
return string(s)
|
|
|
|
}
|