erllama_cache_counters (erllama v0.1.0)
View SourceCache subsystem operational counters.
A single atomics array (one slot per metric) lives in
persistent_term keyed by this module. Hot paths bump slots via
incr/1,2; readers take a snapshot via snapshot/0.
Slot indices are defined in include/erllama_cache.hrl as ?C_*
macros so callers can pass the symbolic constant rather than a
magic integer.
Adapter integrations (Prometheus, statsd, OpenTelemetry, etc.) read
snapshot/0 periodically; this module does not depend on any
external metrics framework.
Summary
Functions
-spec add(pos_integer(), non_neg_integer()) -> ok.
-spec get(pos_integer()) -> non_neg_integer().
-spec incr(pos_integer()) -> ok.
-spec incr(pos_integer(), non_neg_integer()) -> ok.
-spec init() -> ok.
-spec reset() -> ok.
-spec snapshot() -> #{atom() => non_neg_integer()}.