mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:47:20 +08:00
29 lines
949 B
Go
29 lines
949 B
Go
package types
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/shirou/gopsutil/v4/cpu"
|
|
"github.com/shirou/gopsutil/v4/disk"
|
|
"github.com/shirou/gopsutil/v4/host"
|
|
"github.com/shirou/gopsutil/v4/load"
|
|
"github.com/shirou/gopsutil/v4/mem"
|
|
"github.com/shirou/gopsutil/v4/net"
|
|
)
|
|
|
|
// CurrentInfo 监控信息
|
|
type CurrentInfo struct {
|
|
Cpus []cpu.InfoStat `json:"cpus"`
|
|
Percent float64 `json:"percent"` // 总使用率
|
|
Percents []float64 `json:"percents"` // 每个核心使用率
|
|
Load *load.AvgStat `json:"load"`
|
|
Host *host.InfoStat `json:"host"`
|
|
Mem *mem.VirtualMemoryStat `json:"mem"`
|
|
Swap *mem.SwapMemoryStat `json:"swap"`
|
|
Net []net.IOCountersStat `json:"net"`
|
|
DiskIO []disk.IOCountersStat `json:"disk_io"`
|
|
Disk []disk.PartitionStat `json:"disk"`
|
|
DiskUsage []disk.UsageStat `json:"disk_usage"`
|
|
Time time.Time `json:"time"`
|
|
}
|