Files
go2rtc/internal/api/system.go
T
Sergey Krashevich 0b80fa53cf feat(api): add system resource monitoring functionality
- implement getSystemInfo to gather CPU and memory usage
- add platform-specific implementations for memory and CPU usage
- enhance OpenAPI documentation to include system resource metrics
2026-02-13 14:49:20 +03:00

17 lines
354 B
Go

package api
type systemInfo struct {
CPUUsage float64 `json:"cpu_usage"` // percent 0-100
MemTotal uint64 `json:"mem_total"` // bytes
MemUsed uint64 `json:"mem_used"` // bytes
}
func getSystemInfo() systemInfo {
memTotal, memUsed := getMemoryInfo()
return systemInfo{
CPUUsage: getCPUUsage(),
MemTotal: memTotal,
MemUsed: memUsed,
}
}