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.

687 B
Raw Blame
package chat

import (
	"testing"
)

func TestAIMetricsRecording(t *testing.T) {
	m := GetAIMetrics()
	if sanitizeLabel("") != "unknown" {
		t.Fatalf("expected empty label to be sanitized")
	}
	if sanitizeLabel("has space") != "has_space" {
		t.Fatalf("expected spaces to be replaced")
	}

	m.RecordStrictResolutionBlock("validateResolvedResource", "restart")
	m.RecordRoutingMismatchBlock("pulse_control", "node", "vm")
	m.RecordPhantomDetected("provider", "model")
	m.RecordAgenticIteration("provider", "model")

	cb := NewAIMetricsTelemetryCallback()
	cb.RecordStrictResolutionBlock("validateResolvedResource", "start")
	cb.RecordRoutingMismatchBlock("pulse_control", "node", "vm")
}