feat: implement cross-platform metric collector with gopsutil, rename module to nexusrmm.local/agent

This commit is contained in:
Claude Agent
2026-03-19 12:14:14 +01:00
parent 7c85afe39b
commit 51052261f5
5 changed files with 183 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
package collector
import "testing"
func TestCollect(t *testing.T) {
metrics, err := Collect()
if err != nil {
t.Fatalf("Collect() error: %v", err)
}
if metrics.CPUPercent < 0 || metrics.CPUPercent > 100 {
t.Errorf("CPU percent out of range: %f", metrics.CPUPercent)
}
if metrics.MemoryTotal == 0 {
t.Error("MemoryTotal should not be 0")
}
if len(metrics.Disks) == 0 {
t.Error("Expected at least one disk")
}
}