Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiskStatus ¶
type DiskStatus struct {
Path string `json:"path"`
Total uint64 `json:"total"`
Used uint64 `json:"used"`
Free uint64 `json:"free"`
UsedPercent float64 `json:"usedPercent"`
}
func Disk ¶
func Disk(ctx context.Context) []DiskStatus
type Monitor ¶
type Monitor struct {
OsName string `json:"osName"` // OS 名称
BootTime string `json:"bootTime"` // 启动时间
DirSize []DirSize `json:"dirSize"` // 目录大小
KernelVersion string `json:"kernelVersion"` // 内核版本
MemoryTotal string `json:"memoryTotal"` // 内存总量
DiskTotal string `json:"diskTotal"` // 硬盘总量
CpuArch string `json:"cpuArch"` // CPU架构
CpuCount int `json:"cpuCount"` // CPU数量
CpuModel string `json:"cpuModel"` // CPU型号
DefaultDatabase string `json:"defaultDatabase"` // 默认数据库
DefaultQueue string `json:"defaultQueue"` // 默认队列
Debug bool `json:"debug"` // 是否是debug模式
DefaultLang string `json:"defaultLang"` // 默认语言
DefaultTimezone string `json:"defaultTimezone"` // 默认时区
Port string `json:"port"` // 端口
Version string `json:"version"` // 版本
GoVersion string `json:"goVersion"` // Go版本
DatabaseVersion string `json:"databaseVersion"` // 数据库版本
}
type MonitorData ¶
type MonitorData struct {
CpuPercent float64
MemPercent float64
ThreadCount int
GoroutineCount int
Timestamp int64
// IO 负载相关
IOPercent float64 // IO 使用率(百分比)
// CPU 负载
Load1 float64 // 1分钟负载
Load5 float64 // 5分钟负载
Load15 float64 // 15分钟负载
// 网络相关
NetStats []NetStats
}
func GetMonitorData ¶
func GetMonitorData() (*MonitorData, error)
GetMonitorData Retrieve monitoring data
Click to show internal directories.
Click to hide internal directories.