Nebulex.Adapter.Info behaviour (Nebulex v3.0.0-rc.1)

View Source

Specifies the adapter Info API.

See Nebulex.Adapters.Common.Info.

Summary

Callbacks

Returns {:ok, info} where info contains the requested cache information, as specified by the spec.

Callbacks

info(adapter_meta, info_spec, opts)

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.