NebulexRedisAdapter does not implement `c:stats/0`
simoncocking opened this issue · comments
Simon Cocking commented
Given:
defmodule MyCache do
use Nebulex.Cache,
otp_app: :nebulex,
adapter: NebulexRedisAdapter
end
then
iex> MyCache.stats()
** (UndefinedFunctionError) function MyCache.stats/0 is undefined or private, but the behaviour Nebulex.Cache expects it to be present
(my_app 0.1.0) MyCache.stats()
This leaves us unable to obtain Telemetry metrics for this cache.
Carlos Andres Bolaños R.A. commented
Yeah, the adapter does not implement the Nebulex.Adapter.Stats
behaviour, this will be supported soon. Now that it emits the Telemetry span events, it is easy to implement stats similar to the Nebulex.Adapters.Local
by using the provided Telemetry handler Nebulex.Telemetry.StatsHandler
.