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:
@@ -51,6 +51,26 @@ type ContainerStatus struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type ContainerMetricsStatus struct {
|
||||
Exists bool `json:"exists"`
|
||||
TaskRunning bool `json:"task_running"`
|
||||
}
|
||||
|
||||
type ContainerStorageMetrics struct {
|
||||
Path string `json:"path"`
|
||||
UsedBytes uint64 `json:"used_bytes"`
|
||||
}
|
||||
|
||||
type ContainerMetricsResult struct {
|
||||
Supported bool
|
||||
UnsupportedReason string
|
||||
Status ContainerMetricsStatus
|
||||
SampledAt time.Time
|
||||
CPU *ctr.CPUMetrics
|
||||
Memory *ctr.MemoryMetrics
|
||||
Storage *ContainerStorageMetrics
|
||||
}
|
||||
|
||||
type Manager struct {
|
||||
service ctr.Service
|
||||
cfg config.WorkspaceConfig
|
||||
|
||||
Reference in New Issue
Block a user