Documentation
¶
Overview ¶
Package aggregator pre-computes daily rollup metrics for fast dashboard queries. It runs on a configurable interval and writes to the daily_rollups table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator periodically rolls up raw events into daily summaries.
func New ¶
func New(st *pulsestore.Store, intervalSec int) *Aggregator
New creates an Aggregator that rolls up at the given interval.
func NewWithOptions ¶
func NewWithOptions(st *pulsestore.Store, intervalSec int, dbPath string, collDropRate func() float64) *Aggregator
NewWithOptions creates an Aggregator with extended options. dbPath is used to measure DB file size (Bug 27 — ROI-E7). collDropRate is an optional function returning the collector drop rate (Bug 28 — ROI-E8).
func (*Aggregator) Start ¶
func (a *Aggregator) Start()
Start begins the rollup loop. It runs an immediate rollup, then repeats on the configured interval.
func (*Aggregator) Stop ¶
func (a *Aggregator) Stop()
Stop signals the loop to exit and waits for completion. Safe to call multiple times.