Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NebulexRedisAdapter does not implement c:stats/0 #28

Closed
simoncocking opened this issue May 18, 2021 · 1 comment · Fixed by #29
Closed

NebulexRedisAdapter does not implement c:stats/0 #28

simoncocking opened this issue May 18, 2021 · 1 comment · Fixed by #29

Comments

@simoncocking
Copy link
Contributor

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.

@cabol
Copy link
Owner

cabol commented May 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants