mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-08 18:21:55 +00:00
Complete Phase 2 baseline integration: - Add baseline_exports.go for clean type aliasing - Wire baseline store initialization into StartPatrol - Implement startBaselineLearning background loop - Runs initial learning after 5 min delay - Updates baselines every hour from metrics history - Learns from 7 days of data for nodes, VMs, containers - Add SetBaselineStore methods throughout the chain (Router -> AIHandler -> Service -> PatrolService) - Persists baselines to data directory as JSON The baseline learning loop: 1. Starts automatically when AI patrol starts 2. Queries metrics history for all resources 3. Computes mean, stddev, percentiles for cpu/memory/disk 4. Saves baselines to disk for durability 5. Anomaly detection uses these baselines in context builder All tests passing.
24 lines
695 B
Go
24 lines
695 B
Go
package ai
|
|
|
|
import (
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/ai/baseline"
|
|
)
|
|
|
|
// BaselineConfig is an alias for the baseline package config
|
|
type BaselineConfig = baseline.StoreConfig
|
|
|
|
// BaselineStore is an alias for the baseline.Store type
|
|
type BaselineStore = baseline.Store
|
|
|
|
// BaselineMetricPoint is an alias for the baseline.MetricPoint type
|
|
type BaselineMetricPoint = baseline.MetricPoint
|
|
|
|
// DefaultBaselineConfig returns the default baseline configuration
|
|
func DefaultBaselineConfig() BaselineConfig {
|
|
return baseline.DefaultConfig()
|
|
}
|
|
|
|
// NewBaselineStore creates a new baseline store
|
|
func NewBaselineStore(cfg BaselineConfig) *BaselineStore {
|
|
return baseline.NewStore(cfg)
|
|
}
|