增加磁盘信息

This commit is contained in:
2021-10-12 21:39:42 +08:00
parent 516382c402
commit 3aaffbeab2
2 changed files with 70 additions and 0 deletions

View File

@ -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"`
}