feat: enhance metrics collection with disk and network I/O rates, and update frontend to display new data
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user