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

52 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"
)
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:"used_percent"`
InodesTotal uint64 `json:"inodes_total"`
InodesUsed uint64 `json:"inodes_used"`
InodesFree uint64 `json:"inodes_free"`
InodesUsedPercent float64 `json:"inodes_used_percent"`
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 {
ReadCount uint64 `json:"read_count"`
WriteCount uint64 `json:"write_count"`
ReadBytes uint64 `json:"read_bytes"`
WriteBytes uint64 `json:"write_bytes"`
ReadTime uint64 `json:"read_time"`
WriteTime uint64 `json:"write_time"`
2014-09-22 16:35:47 +09:00
Name string `json:"name"`
IoTime uint64 `json:"io_time"`
SerialNumber string `json:"serial_number"`
2014-04-18 16:34:47 +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)
}