fix: increase MetricSamples to 24 points for hourly resolution

12 samples was too coarse (2-hour intervals could miss spikes).
24 samples gives ~hourly resolution while still being compact.
This commit is contained in:
rcourtman 2025-12-21 22:24:02 +00:00
parent 9176e54b80
commit 818fbffd66

View file

@ -486,9 +486,9 @@ func (b *Builder) computeGuestMetricSamples(guestID string) map[string][]MetricP
if len(points) < 3 { if len(points) < 3 {
continue continue
} }
// Downsample to ~12 points (roughly every 2 hours over 24h) // Downsample to ~24 points (roughly hourly over 24h)
// This gives the LLM a compact view of recent trends // This gives the LLM good resolution to spot patterns and spikes
sampled := DownsampleMetrics(points, 12) sampled := DownsampleMetrics(points, 24)
if len(sampled) >= 3 { if len(sampled) >= 3 {
samples[metric] = sampled samples[metric] = sampled
} }