增加磁盘信息
This commit is contained in:
@ -9,6 +9,7 @@ package system
|
||||
|
||||
import (
|
||||
"github.com/shirou/gopsutil/cpu"
|
||||
"github.com/shirou/gopsutil/disk"
|
||||
"github.com/shirou/gopsutil/load"
|
||||
)
|
||||
|
||||
@ -34,3 +35,24 @@ type CPUCoreCnt struct {
|
||||
Logical int `json:"logical"` // 逻辑核数
|
||||
Physical int `json:"physical"` // 物理核数
|
||||
}
|
||||
|
||||
// DiskDetail 磁盘信息
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 8:12 下午 2021/10/12
|
||||
type DiskDetail struct {
|
||||
PartitionStat disk.PartitionStat `json:"partition_stat"`
|
||||
DiskStat *disk.UsageStat `json:"disk_stat"`
|
||||
MemoryUnit string `json:"memory_unit"` // 空间的单位 KB / MB / GB
|
||||
}
|
||||
|
||||
// OutputDiskInfo 磁盘信息
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 8:40 下午 2021/10/12
|
||||
type OutputDiskInfo struct {
|
||||
DiskList []*DiskDetail `json:"disk_list"`
|
||||
IOStat map[string]disk.IOCountersStat `json:"io_stat"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user