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

[Feature Request] Refactor ICache.stats() to return an interface rather than ImmutableCacheStatsHolder #13451

Open
peteralfonsi opened this issue Apr 29, 2024 · 1 comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance

Comments

@peteralfonsi
Copy link
Contributor

Is your feature request related to a problem? Please describe

In the backend of the new cache stats API, currently ICache implementations return a concrete class (ImmutableCacheStatsHolder) when providing a fixed snapshot of the cache's stats. We may want to refactor this to use an interface in case we want additional implementations later on.

Describe the solution you'd like

We could create an interface, possibly "CacheStats" or "CacheStatsResponse", which has similar logic of being aggregated by levels at creation time, and also implements Writeable and ToXContent. One downside is that serializing such an interface would be a bit messy, and might require writing class names into the StreamOutput or a similar approach.

Related component

Search:Performance

Describe alternatives you've considered

The status quo also works for now, but we might want to add this flexibility.

Additional context

No response

@peteralfonsi peteralfonsi added enhancement Enhancement or improvement to existing feature or request untriaged labels Apr 29, 2024
@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5 6 7 8]
@peteralfonsi Thanks for creating this issue, looking forward to a pull request to address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance
Projects
Status: Next (Next Quarter)
Development

No branches or pull requests

2 participants