TimelessMetrics.SeriesRegistry (timeless_metrics v6.0.15)

Copy Markdown View Source

Hybrid persistent_term + ETS series ID lookup and registration.

The hot read path uses persistent_term (zero-copy shared Map). New series spill into an ETS overflow table and are periodically batch-merged into persistent_term to avoid literal-heap churn.

Steady state: 100% persistent_term hits, ETS overflow is empty.

Summary

Functions

Returns a specification to start this module under a supervisor.

Return the number of registered series.

Flush pending series registrations to SQLite synchronously.

Get or create a series ID for the given metric name and labels. Fast path: persistent_term Map lookup (zero-copy). Warm path: ETS overflow lookup (during warm-up). Slow path: GenServer → SQLite → ETS overflow → deferred publish.

Lookup series metadata by ID.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

count(registry)

Return the number of registered series.

flush_pending(registry)

Flush pending series registrations to SQLite synchronously.

get_or_create(registry, metric_name, labels)

Get or create a series ID for the given metric name and labels. Fast path: persistent_term Map lookup (zero-copy). Warm path: ETS overflow lookup (during warm-up). Slow path: GenServer → SQLite → ETS overflow → deferred publish.

lookup(registry, series_id)

Lookup series metadata by ID.

start_link(opts)