1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-28 13:48:49 +08:00

53 lines
1.3 KiB
Go
Raw Normal View History

2014-12-30 22:09:05 +09:00
package disk
2014-04-18 16:34:47 +09:00
import (
"encoding/json"
)
type UsageStat struct {
2014-08-26 22:17:35 +09:00
Path string `json:"path"`
Fstype string `json:"fstype"`
2014-08-26 22:17:35 +09:00
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"`
InodesUsedPercent float64 `json:"inodesUsedPercent"`
2014-04-18 16:34:47 +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"`
}
type IOCountersStat struct {
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"`
IoTime uint64 `json:"ioTime"`
SerialNumber string `json:"serialNumber"`
2014-04-18 16:34:47 +09:00
}
func (d UsageStat) String() string {
s, _ := json.Marshal(d)
return string(s)
}
func (d PartitionStat) String() string {
s, _ := json.Marshal(d)
return string(s)
}
func (d IOCountersStat) String() string {
s, _ := json.Marshal(d)
return string(s)
}