-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Subgroup cluster stats so that later we can lazy init some of the subgroups to save RAM/GCU. #23523
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
Changes from 4 commits
230b570
4c1a076
aba2717
9b51c85
e370c84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -792,6 +792,7 @@ class ClusterInfoImpl : public ClusterInfo, | |
| ResourceManager& resourceManager(ResourcePriority priority) const override; | ||
| TransportSocketMatcher& transportSocketMatcher() const override { return *socket_matcher_; } | ||
| ClusterStats& stats() const override { return stats_; } | ||
| ClusterConfigUpdateStats& configUpdateStats() const override { return config_update_stats_; } | ||
| Stats::Scope& statsScope() const override { return *stats_scope_; } | ||
|
|
||
| ClusterRequestResponseSizeStatsOptRef requestResponseSizeStats() const override { | ||
|
|
@@ -906,6 +907,7 @@ class ClusterInfoImpl : public ClusterInfo, | |
| TransportSocketMatcherPtr socket_matcher_; | ||
| Stats::ScopeSharedPtr stats_scope_; | ||
| mutable ClusterStats stats_; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so IIRC the game-plan would be to convert this to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right. more PRs to come.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put the AtomicPtr in this PR, otherwise this PR actually increases memory usage, even in the case where some clusters get no traffic. It will definitely increase memory usage (by a small amount) when all clusters get traffic. But those situations probably don't have a huge number of clusters.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to have another "refactoring" PR before actually introduce the "lazy-init" Struct, to hopefully make the PR easier to read. |
||
| mutable ClusterConfigUpdateStats config_update_stats_; | ||
| Stats::IsolatedStoreImpl load_report_stats_store_; | ||
| mutable ClusterLoadReportStats load_report_stats_; | ||
| const std::unique_ptr<OptionalClusterStats> optional_cluster_stats_; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some comments here about the rationale for the partitioning would help.
In particular, what I think you mean to have here is a block of stats you expect to be incremented for clusters that see zero traffic.
Whereas ALL_CLUSTER_STATS (which should be re-named as that's now a lie :) are stats that you expect to only be incremented when a cluster sees traffic. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. I will more details in comment.