Documentation
¶
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 batches per-tenant, per-kind byte counts and flushes them on an interval, the same pattern as analytics.Aggregator. Add is the non-blocking hot path. A nil FlushFunc disables the ticker.
func NewAggregator ¶
NewAggregator returns an aggregator. If fn is nil, Start is a no-op.
func (*Aggregator) Add ¶
func (a *Aggregator) Add(tenantID uuid.UUID, kind Kind, n int64)
Add increments the tenant's counter for kind. Safe on a nil receiver.
func (*Aggregator) AddLogs ¶
func (a *Aggregator) AddLogs(tenantID uuid.UUID, n int64)
AddLogs increments the tenant's log-ingest counter. Safe on a nil receiver.
func (*Aggregator) AddOtel ¶
func (a *Aggregator) AddOtel(tenantID uuid.UUID, n int64)
AddOtel increments the tenant's OTLP-ingest counter. Safe on a nil receiver.
func (*Aggregator) Shutdown ¶
func (a *Aggregator) Shutdown() error
Shutdown stops the ticker and flushes remaining counters once.
func (*Aggregator) Start ¶
func (a *Aggregator) Start()
Start runs the flush ticker. Safe on a nil receiver or when no flush func is set.
type FlushFunc ¶
type FlushFunc func(tenants map[uuid.UUID]TenantBytes) error
FlushFunc receives a snapshot of tenant → log/otel bytes since the last flush. A non-nil error is logged and the snapshot is dropped (best-effort undercount).
type Kind ¶
type Kind string
Kind is a separately buffered ingest source. Both kinds flush together but stay distinct through to Autumn event names.
type TenantBytes ¶
TenantBytes is one tenant's buffered ingest since the last flush.