refactor: switch cachex stats to telemetry polling#3156
refactor: switch cachex stats to telemetry polling#3156ruslandoga wants to merge 5 commits intoLogflare:mainfrom
Conversation
| ["Logflare", context, "Cache"] = Module.split(cache) | ||
| {cache, context |> Macro.underscore() |> String.to_atom()} | ||
| end) | ||
|
|
There was a problem hiding this comment.
This evaluates to
[
{Logflare.TeamUsers.Cache, :team_users},
{Logflare.Partners.Cache, :partners},
{Logflare.Users.Cache, :users},
{Logflare.Backends.Cache, :backends},
{Logflare.Sources.Cache, :sources},
{Logflare.Billing.Cache, :billing},
{Logflare.SourceSchemas.Cache, :source_schemas},
{Logflare.Auth.Cache, :auth},
{Logflare.Endpoints.Cache, :endpoints},
{Logflare.Rules.Cache, :rules},
{Logflare.SavedSearches.Cache, :saved_searches}
]or should it be hardcoded?
There was a problem hiding this comment.
can you inverse the logic so that we can do list_contexts_to_cache() and in list_caches it will call list_contexts_to_cache/0 and concat the .Cache
There was a problem hiding this comment.
the module.split isn't very pretty 😆
There was a problem hiding this comment.
besides that, its fine with keeping it dynamic.
|
@Ziinc 👋 I think this is ready for review. |
Ziinc
left a comment
There was a problem hiding this comment.
just minor refactoring for cleaner code
| ["Logflare", context, "Cache"] = Module.split(cache) | ||
| {cache, context |> Macro.underscore() |> String.to_atom()} | ||
| end) | ||
|
|
There was a problem hiding this comment.
can you inverse the logic so that we can do list_contexts_to_cache() and in list_caches it will call list_contexts_to_cache/0 and concat the .Cache
| ["Logflare", context, "Cache"] = Module.split(cache) | ||
| {cache, context |> Macro.underscore() |> String.to_atom()} | ||
| end) | ||
|
|
There was a problem hiding this comment.
the module.split isn't very pretty 😆
| ["Logflare", context, "Cache"] = Module.split(cache) | ||
| {cache, context |> Macro.underscore() |> String.to_atom()} | ||
| end) | ||
|
|
There was a problem hiding this comment.
besides that, its fine with keeping it dynamic.
ANL-1033
Removed log-based Cachex stats collection in favor of telemetry-based polling system.