Nebulex.Adapter.Info behaviour (Nebulex v3.0.0-rc.1)
View SourceSpecifies the adapter Info API.
Summary
Callbacks
Returns {:ok, info} where info contains the requested cache information,
as specified by the spec.
Callbacks
@callback info( Nebulex.Adapter.adapter_meta(), Nebulex.Cache.info_spec(), Nebulex.Cache.opts() ) :: Nebulex.Cache.ok_error_tuple(Nebulex.Cache.info_data())
Returns {:ok, info} where info contains the requested cache information,
as specified by the spec.
If there's an error with executing the command, {:error, reason}
is returned, where reason is the cause of the error.
The spec (information specification key) can be:
- The atom
:all: returns a map with all information items. - An atom: returns the value for the requested information item.
- A list of atoms: returns a map only with the requested information items.
The adapters are free to add the information specification keys they want, however, Nebulex suggests the adapters add the following specs:
:server- General information about the cache server (e.g., cache name, adapter, PID, etc.).:memory- Memory consumption information (e.g., used memory, allocated memory, etc.).:stats- Cache statistics (e.g., hits, misses, etc.).
See Nebulex.Cache.info/2.