1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +08:00
2014-11-27 10:18:15 +09:00

52 lines
1.3 KiB
Go

package gopsutil
import (
"encoding/json"
)
type DiskUsageStat struct {
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"`
InodesUsedPercent float64 `json:"inodesUsedPercent"`
}
type DiskPartitionStat struct {
Device string `json:"device"`
Mountpoint string `json:"mountpoint"`
Fstype string `json:"fstype"`
Opts string `json:"opts"`
}
type DiskIOCountersStat 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"`
Name string `json:"name"`
IoTime uint64 `json:"ioTime"`
SerialNumber string `json:"serialNumber"`
}
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)
}