Documentation
¶
Index ¶
- type AgentMetric
- type AgentSummary
- type Store
- func (s *Store) Increment(ctx context.Context, instanceID, metricName string) error
- func (s *Store) IncrementBy(ctx context.Context, instanceID, metricName string, delta int64) error
- func (s *Store) QueryAgent(ctx context.Context, instanceID, period string) ([]AgentMetric, error)
- func (s *Store) QueryAll(ctx context.Context, period string) ([]AgentMetric, error)
- func (s *Store) Summarize(ctx context.Context, period string) ([]AgentSummary, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentMetric ¶
type AgentMetric struct {
InstanceID string `json:"instance_id"`
MetricName string `json:"metric_name"`
MetricValue int64 `json:"metric_value"`
Period string `json:"period"`
}
AgentMetric is a single metric record for an agent in a time period.
type AgentSummary ¶
type AgentSummary struct {
InstanceID string `json:"instance_id"`
Metrics map[string]int64 `json:"metrics"`
}
AgentSummary is an aggregate view of all metrics for one agent.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides per-agent metric aggregation in hourly buckets.
func (*Store) Increment ¶
Increment adds 1 to the named metric for the given instance in the current hourly bucket.
func (*Store) IncrementBy ¶
IncrementBy adds delta to the named metric for the given instance in the current hourly bucket.
func (*Store) QueryAgent ¶
QueryAgent returns all metrics for a specific agent, optionally filtered by period prefix. If period is empty, returns all periods. If period is e.g. "2026-02-16", returns all hours that day.
Click to show internal directories.
Click to hide internal directories.