mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 02:36:17 +01:00
refactor: agent and entities
This commit is contained in:
@@ -1,8 +1,42 @@
|
||||
package system
|
||||
|
||||
import "beszel/internal/entities/container"
|
||||
import (
|
||||
"beszel/internal/entities/container"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SystemInfo struct {
|
||||
type Stats struct {
|
||||
Cpu float64 `json:"cpu"`
|
||||
Mem float64 `json:"m"`
|
||||
MemUsed float64 `json:"mu"`
|
||||
MemPct float64 `json:"mp"`
|
||||
MemBuffCache float64 `json:"mb"`
|
||||
Swap float64 `json:"s"`
|
||||
SwapUsed float64 `json:"su"`
|
||||
Disk float64 `json:"d"`
|
||||
DiskUsed float64 `json:"du"`
|
||||
DiskPct float64 `json:"dp"`
|
||||
DiskRead float64 `json:"dr"`
|
||||
DiskWrite float64 `json:"dw"`
|
||||
NetworkSent float64 `json:"ns"`
|
||||
NetworkRecv float64 `json:"nr"`
|
||||
}
|
||||
|
||||
type DiskIoStats struct {
|
||||
Read uint64
|
||||
Write uint64
|
||||
Time time.Time
|
||||
Filesystem string
|
||||
}
|
||||
|
||||
type NetIoStats struct {
|
||||
BytesRecv uint64
|
||||
BytesSent uint64
|
||||
Time time.Time
|
||||
Name string
|
||||
}
|
||||
|
||||
type Info struct {
|
||||
Cores int `json:"c"`
|
||||
Threads int `json:"t"`
|
||||
CpuModel string `json:"m"`
|
||||
@@ -13,8 +47,9 @@ type SystemInfo struct {
|
||||
DiskPct float64 `json:"dp"`
|
||||
}
|
||||
|
||||
type SystemData struct {
|
||||
Stats *SystemStats `json:"stats"`
|
||||
Info *SystemInfo `json:"info"`
|
||||
Containers []*container.ContainerStats `json:"container"`
|
||||
// Final data structure to return to the hub
|
||||
type CombinedData struct {
|
||||
Stats *Stats `json:"stats"`
|
||||
Info *Info `json:"info"`
|
||||
Containers []*container.Stats `json:"container"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user