RaftEx.Counters (raft_ex v0.1.0)

View Source

Thin wrapper around the :seshat counter library.

Falls back to no-ops gracefully when :seshat is unavailable so that the rest of the codebase can call these functions unconditionally.

Summary

Functions

counters(name, fields)

@spec counters(term(), [atom()]) :: map() | nil

delete(name)

@spec delete(term()) :: :ok

fetch(name)

@spec fetch(term()) :: map() | nil

init()

@spec init() :: :ok

Initialise the seshat counter group. Safe to call more than once.

new(name, fields_spec)

@spec new(term(), list()) :: :ok

new(name, fields_spec, labels)

@spec new(term(), list(), map()) :: :ok

overview()

@spec overview() :: map()

overview(name)

@spec overview(term()) :: map()