-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Reuse metric names in TopMetricsAggregator #116296
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
@elasticmachine update branch |
@elasticmachine update branch |
@elasticmachine update branch |
@elasticmachine update branch |
@elasticmachine update branch |
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.
LGTM
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.
LGTM.
|
||
Metrics(MetricValues[] values) { | ||
this.values = values; | ||
names = new ArrayList<>(values.length); | ||
for (MetricValues value : values) { |
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 agree that the for loop is more readable here than the stream.
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.
And the stream was creating a list with initial size of 10 although we were adding only one element.
💚 Backport successful
|
This commit shares a unique instance between all InternalTopMetrics instances.
This commit shares a unique instance between all InternalTopMetrics instances.
This commit shares a unique instance between all InternalTopMetrics instances.
This commit shares a unique instance between all InternalTopMetrics instances.
I noticed in a heapdump that we are creating a new list of names for each new InternalTopMetrics created which seems wasteful as we can be creating thousand of those objects during an aggregation execution. This commit shares a unique instance between all InternalTopMetrics instances.