mirror of
https://github.com/henrygd/beszel.git
synced 2026-03-22 05:36:15 +01:00
add system_details collection for infrequently updated data
- add includedetails flag to data requests for better efficiency - integrate docker host info api for better os detection - pull more OS details as well as cpu arch - separate info bar component and refactor for new info
This commit is contained in:
@@ -34,6 +34,14 @@ type ApiStats struct {
|
||||
MemoryStats MemoryStats `json:"memory_stats"`
|
||||
}
|
||||
|
||||
// Docker system info from /info API endpoint
|
||||
type HostInfo struct {
|
||||
OperatingSystem string `json:"OperatingSystem"`
|
||||
KernelVersion string `json:"KernelVersion"`
|
||||
NCPU int `json:"NCPU"`
|
||||
MemTotal uint64 `json:"MemTotal"`
|
||||
}
|
||||
|
||||
func (s *ApiStats) CalculateCpuPercentLinux(prevCpuContainer uint64, prevCpuSystem uint64) float64 {
|
||||
cpuDelta := s.CPUStats.CPUUsage.TotalUsage - prevCpuContainer
|
||||
systemDelta := s.CPUStats.SystemUsage - prevCpuSystem
|
||||
|
||||
Reference in New Issue
Block a user