feat: enhance metrics collection with disk and network I/O rates, and update frontend to display new data

This commit is contained in:
Jonathan Atta
2026-03-11 18:10:28 +01:00
parent 29e8f9b887
commit d58003feb7
4 changed files with 275 additions and 242 deletions

View File

@@ -16,9 +16,11 @@ import (
)
func runServer(port int) {
_, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
streamSys := backend.NewSysInfoHeadless(ctx)
mux := http.NewServeMux()
// GET /api/metrics — latest snapshot
@@ -61,7 +63,7 @@ func runServer(port int) {
case <-r.Context().Done():
return
case <-ticker.C:
m, err := backend.CollectFull(r.Context())
m, err := streamSys.Snapshot()
if err != nil {
continue
}