Documentation
¶
Index ¶
- func RegisterRoutes(mux *http.ServeMux, c *Collector)
- type AgentMetric
- type Collector
- func (c *Collector) AgentMetrics() []AgentMetric
- func (c *Collector) KnowledgeStats() *KBStats
- func (c *Collector) LLMHealth() *LLMMetrics
- func (c *Collector) ServerHealth() ServerMetrics
- func (c *Collector) SetAgentCountFunc(fn func() (llm, strategy int))
- func (c *Collector) SetAgentMetricsFunc(fn func() []AgentMetric)
- func (c *Collector) SetKBStatsFunc(fn func() *KBStats)
- func (c *Collector) SetLLMMetricsFunc(fn func() *LLMMetrics)
- type KBStats
- type LLMMetrics
- type ServerMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
RegisterRoutes registers the admin monitoring REST endpoints on the given mux.
Types ¶
type AgentMetric ¶
type AgentMetric struct {
AgentID string `json:"agent_id"`
Type string `json:"type"` // "llm" or "strategy"
Strategy string `json:"strategy,omitempty"`
Status string `json:"status"`
ActionsTotal int64 `json:"actions_total"`
ErrorsTotal int64 `json:"errors_total"`
LastAction time.Time `json:"last_action,omitzero"`
LLMLatency time.Duration `json:"llm_latency_ms,omitzero"`
Team string `json:"team,omitempty"`
System string `json:"system,omitempty"`
Docked bool `json:"docked"`
}
AgentMetric holds per-agent runtime metrics.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector gathers server and agent metrics.
func (*Collector) AgentMetrics ¶
func (c *Collector) AgentMetrics() []AgentMetric
AgentMetrics returns per-agent metrics from the configured provider.
func (*Collector) KnowledgeStats ¶
KnowledgeStats returns knowledge base statistics from the configured provider.
func (*Collector) LLMHealth ¶
func (c *Collector) LLMHealth() *LLMMetrics
LLMHealth returns LLM provider metrics from the configured provider.
func (*Collector) ServerHealth ¶
func (c *Collector) ServerHealth() ServerMetrics
ServerHealth returns current server health metrics.
func (*Collector) SetAgentCountFunc ¶
SetAgentCountFunc sets the function used to retrieve agent counts.
func (*Collector) SetAgentMetricsFunc ¶
func (c *Collector) SetAgentMetricsFunc(fn func() []AgentMetric)
SetAgentMetricsFunc sets the function used to retrieve per-agent metrics.
func (*Collector) SetKBStatsFunc ¶
SetKBStatsFunc sets the function used to retrieve knowledge base stats.
func (*Collector) SetLLMMetricsFunc ¶
func (c *Collector) SetLLMMetricsFunc(fn func() *LLMMetrics)
SetLLMMetricsFunc sets the function used to retrieve LLM metrics.
type KBStats ¶
type KBStats struct {
Systems int `json:"systems"`
POIs int `json:"pois"`
Bases int `json:"bases"`
Experiences int `json:"experiences"`
Items int `json:"items"`
}
KBStats holds knowledge base statistics.
type LLMMetrics ¶
type LLMMetrics struct {
AvgLatency time.Duration `json:"avg_latency_ms"`
P99Latency time.Duration `json:"p99_latency_ms"`
ErrorRate float64 `json:"error_rate"`
RequestsMin float64 `json:"requests_per_min"`
TotalCalls int64 `json:"total_calls"`
TotalErrors int64 `json:"total_errors"`
}
LLMMetrics tracks LLM provider health.
type ServerMetrics ¶
type ServerMetrics struct {
Uptime time.Duration `json:"uptime_seconds"`
GoRoutines int `json:"goroutines"`
HeapAllocMB float64 `json:"heap_alloc_mb"`
HeapSysMB float64 `json:"heap_sys_mb"`
NumGC uint32 `json:"num_gc"`
TotalAgents int `json:"total_agents"`
LLMAgents int `json:"llm_agents"`
StrategyAgents int `json:"strategy_agents"`
}
ServerMetrics holds overall server health metrics.