mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat(container): add current container metrics view
Expose a dedicated container metrics endpoint and surface current CPU, memory, and root filesystem usage in the bot container view. This gives operators a quick health snapshot while degrading cleanly on unsupported backends.
This commit is contained in:
@@ -61,6 +61,25 @@ type TaskInfo struct {
|
||||
ExitCode uint32
|
||||
}
|
||||
|
||||
type ContainerMetrics struct {
|
||||
SampledAt time.Time
|
||||
CPU *CPUMetrics
|
||||
Memory *MemoryMetrics
|
||||
}
|
||||
|
||||
type CPUMetrics struct {
|
||||
UsagePercent float64
|
||||
UsageNanoseconds uint64
|
||||
UserNanoseconds uint64
|
||||
KernelNanoseconds uint64
|
||||
}
|
||||
|
||||
type MemoryMetrics struct {
|
||||
UsageBytes uint64
|
||||
LimitBytes uint64
|
||||
UsagePercent float64
|
||||
}
|
||||
|
||||
type SnapshotInfo struct {
|
||||
Name string
|
||||
Parent string
|
||||
|
||||
Reference in New Issue
Block a user