Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiskData ¶
type DiskData struct {
Device string `json:"device"` // 分区
MountPoint string `json:"mount_point"` // 挂载点
FsType string `json:"fs_type"` // 文件系统类型
Usage DiskUsage `json:"usage"`
Opts []string `json:"opts"`
}
func GetDiskData ¶
GetDiskData 获取硬盘信息
type DiskUsage ¶
type DiskUsage struct {
Path string `json:"path"`
FsType string `json:"fs_type"`
TotalGB float64 `json:"total_gb"`
FreeGB float64 `json:"free_gb"`
UsedGB float64 `json:"used_gb"`
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"`
}
type MemoryData ¶
type ProgressData ¶
type ProgressData struct {
PID int32 `json:"pid"`
Name string `json:"name"`
CpuPercent float64 `json:"cpu_percent"` // cpu占用
MemoryUsedMB float64 `json:"memory_used_mb"` // 内存使用MB(常驻集)
MemoryPer float64 `json:"memory_per"` // 内存占用
CmdLines []string `json:"cmd_lines"` // 命令参数
}
func GetProgressRank ¶
func GetProgressRank(topNum int, sequenceFlag SequenceFlag, nameFilter string) (processInfos []ProgressData, err error)
GetProgressRank 获取cpu占用进程排行榜
type SequenceFlag ¶
type SequenceFlag int
const CpuUsage SequenceFlag = 1
const MemoryUsage SequenceFlag = 2
type SystemData ¶
type SystemData struct {
CPU CpuData `json:"cpu"`
Memory MemoryData `json:"memory"`
Disk []DiskData `json:"disk"`
}
func GetSystemInfo ¶
func GetSystemInfo(getLogicalDisk bool) (systemData SystemData, err error)
Click to show internal directories.
Click to hide internal directories.