Sharded ETS write buffer.
Incoming metrics land in one of N ETS shards (selected by series_id). Each shard flushes periodically or when a point threshold is exceeded, handing accumulated points to the SegmentBuilder for compression.
Supports backpressure: when the SegmentBuilder mailbox exceeds a
configurable threshold, writes return {:error, :backpressure}.
Summary
Functions
Get the current point count in this shard's buffer.
Returns a specification to start this module under a supervisor.
Read buffered points for a series within a time range. Lock-free.
Write a point to the appropriate shard's ETS table. Lock-free.
Bulk-write pre-resolved points to a shard. Called by write_batch.
Functions
Get the current point count in this shard's buffer.
Returns a specification to start this module under a supervisor.
See Supervisor.
Read buffered points for a series within a time range. Lock-free.
Write a point to the appropriate shard's ETS table. Lock-free.
Returns :ok on success or {:error, :backpressure} if the
SegmentBuilder is overwhelmed.
Bulk-write pre-resolved points to a shard. Called by write_batch.
points is a list of {series_id, timestamp, value} tuples.
Single ETS insert + single atomics update for the whole batch.