feat(nodes): live CPU/RAM/disk monitoring in the node list
Build backend images / build content-svc (push) Failing after 45s
Build backend images / build file-svc (push) Failing after 55s
Build backend images / build gateway (push) Failing after 53s
Build backend images / build identity-svc (push) Failing after 54s
Build backend images / build notification-svc (push) Failing after 53s
Build backend images / build render-svc (push) Failing after 47s
Build backend images / build studio-svc (push) Failing after 51s
Build backend images / build content-svc (push) Failing after 45s
Build backend images / build file-svc (push) Failing after 55s
Build backend images / build gateway (push) Failing after 53s
Build backend images / build identity-svc (push) Failing after 54s
Build backend images / build notification-svc (push) Failing after 53s
Build backend images / build render-svc (push) Failing after 47s
Build backend images / build studio-svc (push) Failing after 51s
- node-agent: internal/metrics — read CPU% (GetSystemTimes), RAM (GlobalMemoryStatusEx), disk used%/total (GetDiskFreeSpaceEx) via stdlib kernel32 (no external dep; windows build + non-windows stub). Heartbeat now reports cpu_pct/ram_available_mb/disk_used_pct/ disk_total_gb + ae_running. - render-svc: heartbeat persists last_disk_pct + disk_total_gb (migration 29); RenderNode model + node SELECT/scan carry them. - admin: rewrite NodesTable to the real RenderNode shape (fixes a pre-existing items/V2Node mismatch that left the list empty) + a CPU/RAM/disk bars column + stale-heartbeat flag. - assets-bundle ingestion: ProjectMediaBundle (jszip) auto-maps project.zip → project/scene image/demo/colour + music; PatchProject gains image/full_demo/shared_colors_svg. - scan: RGBA (4-number) colours recognised + frshare single-int controls detected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,7 @@ import (
|
||||
|
||||
"github.com/flatrender/node-agent/internal/client"
|
||||
"github.com/flatrender/node-agent/internal/config"
|
||||
"github.com/flatrender/node-agent/internal/metrics"
|
||||
"github.com/flatrender/node-agent/internal/runner"
|
||||
)
|
||||
|
||||
@@ -324,10 +325,22 @@ func (a *Agent) heartbeatLoop(ctx context.Context) {
|
||||
|
||||
func (a *Agent) sendHeartbeat(ctx context.Context) {
|
||||
status, jobID := a.getStatus()
|
||||
|
||||
// Live host metrics (Windows kernel32; stub elsewhere). CPU samples ~300ms.
|
||||
cpu := metrics.CPUPercent(300 * time.Millisecond)
|
||||
_, ramAvail := metrics.Memory()
|
||||
diskPct, diskTotal := metrics.Disk(a.cfg.WorkDir)
|
||||
aeRunning := a.cfg.AEPath != "" && a.isBusy()
|
||||
|
||||
req := client.HeartbeatRequest{
|
||||
NodeID: a.cfg.NodeID,
|
||||
Status: status,
|
||||
CurrentJobID: jobID,
|
||||
NodeID: a.cfg.NodeID,
|
||||
Status: status,
|
||||
CurrentJobID: jobID,
|
||||
CPUPct: &cpu,
|
||||
RAMAvailableMB: &ramAvail,
|
||||
DiskUsedPct: &diskPct,
|
||||
DiskTotalGB: &diskTotal,
|
||||
AERunning: &aeRunning,
|
||||
}
|
||||
hbCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user