- Client: Go-based Windows hardware monitoring (CPU, GPU, memory, disk, network, power) - Server: Go + Gin + SQLite backend with REST API - Frontend: Vue 3 + Element Plus dashboard - Docker deployment support - Windows service installation script
55 lines
1.4 KiB
Go
55 lines
1.4 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Metrics struct {
|
|
DeviceID string `json:"device_id"`
|
|
Timestamp time.Time `json:"timestamp"`
|
|
|
|
// CPU
|
|
CPUUsage float64 `json:"cpu_usage"`
|
|
CPUTemperature float64 `json:"cpu_temperature"`
|
|
CPUCoreUsage []float64 `json:"cpu_core_usage"`
|
|
|
|
// Memory
|
|
MemoryTotal uint64 `json:"memory_total"`
|
|
MemoryUsed uint64 `json:"memory_used"`
|
|
MemoryUsage float64 `json:"memory_usage"`
|
|
|
|
// GPU
|
|
GPUUsage float64 `json:"gpu_usage"`
|
|
GPUTemperature float64 `json:"gpu_temperature"`
|
|
GPUMemoryTotal uint64 `json:"gpu_memory_total"`
|
|
GPUMemoryUsed uint64 `json:"gpu_memory_used"`
|
|
GPUName string `json:"gpu_name"`
|
|
|
|
// Network
|
|
NetworkInterfaces []NetInterface `json:"network_interfaces"`
|
|
|
|
// Disk
|
|
Disks []DiskInfo `json:"disks"`
|
|
|
|
// Power
|
|
PowerStatus string `json:"power_status"`
|
|
BatteryLevel int `json:"battery_level"`
|
|
PowerSource string `json:"power_source"`
|
|
}
|
|
|
|
type NetInterface struct {
|
|
Name string `json:"name"`
|
|
MACAddress string `json:"mac_address"`
|
|
IPAddress string `json:"ip_address"`
|
|
BytesSent uint64 `json:"bytes_sent"`
|
|
BytesRecv uint64 `json:"bytes_recv"`
|
|
Speed uint64 `json:"speed"`
|
|
IsUp bool `json:"is_up"`
|
|
}
|
|
|
|
type DiskInfo struct {
|
|
MountPoint string `json:"mount_point"`
|
|
Total uint64 `json:"total"`
|
|
Used uint64 `json:"used"`
|
|
Usage float64 `json:"usage"`
|
|
FileSystem string `json:"file_system"`
|
|
}
|