Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Time the legacy libvirt rate test across both receipts

rcourtman0be163acef6f
diff --git a/internal/monitoring/agent_report_libvirt_clock_test.go b/internal/monitoring/agent_report_libvirt_clock_test.go
index 5bcf3c2590..840a5d6dbe 100644
--- a/internal/monitoring/agent_report_libvirt_clock_test.go
+++ b/internal/monitoring/agent_report_libvirt_clock_test.go
@@ -311,8 +311,10 @@ func TestApplyHostReportLegacyLibvirtRatesStayOnReceiptTime(t *testing.T) {
report := func(slot int) agentshost.Report {
return agent.libvirtHostReport("", 0, slot, agent.collectedAt(slot), agent.libvirtCollectedAt(slot), agent.libvirtDomain(slot, 0))
}
- applyCounterClockHost(t, m, report(1))
+ // Start the clock before the first report so wall spans both receipt
+ // stamps; starting after it let a slow first apply exceed the second's.
sentAt := time.Now()
+ applyCounterClockHost(t, m, report(1))
domain := libvirtClockDomain(t, "legacy", applyCounterClockHost(t, m, report(2)))
wall := time.Since(sentAt).Seconds()
if !domain.CPUUsageValid || !domain.IORatesValid {