Pulse/internal/hostmetrics/collector_test.go
rcourtman cc3c0187a0 feat: AI features, agent improvements, and host monitoring enhancements
AI Chat Integration:
- Multi-provider support (Anthropic, OpenAI, Ollama)
- Streaming responses with markdown rendering
- Agent command execution for remote troubleshooting
- Context-aware conversations with host/container metadata

Agent Updates:
- Add --enable-proxmox flag for automatic PVE/PBS token setup
- Improve auto-update with semver comparison (prevents downgrades)
- Add updatedFrom tracking to report previous version after update
- Reduce initial update check delay from 30s to 5s
- Add agent version column to Hosts page table

Host Metrics:
- Add DiskIO stats collection (read/write bytes, ops, time)
- Improve disk filtering to exclude Docker overlay mounts
- Add RAID array monitoring via mdadm
- Enhanced temperature sensor parsing

Frontend:
- New Agent Version column on Hosts overview table
- Improved node modal with agent-first installation flow
- Add DiskIO display in host drawer
- Better responsive handling for metric bars
2025-12-05 10:37:02 +00:00

25 lines
532 B
Go

package hostmetrics
import (
"context"
"encoding/json"
"testing"
)
func TestCollectDiskIO(t *testing.T) {
ctx := context.Background()
snapshot, err := Collect(ctx)
if err != nil {
t.Fatalf("Collect failed: %v", err)
}
t.Logf("DiskIO count: %d", len(snapshot.DiskIO))
if len(snapshot.DiskIO) == 0 {
t.Error("Expected disk IO data but got none")
}
data, _ := json.MarshalIndent(snapshot.DiskIO, "", " ")
t.Logf("DiskIO data:\n%s", string(data))
}