-
Notifications
You must be signed in to change notification settings - Fork 440
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
Re-use memory via aggregate functions #1266
Conversation
This simplifies memory reuse on subsequent collection cycles. Also small ergonomics changes: * Move `MetricsProducer` config to builders to match other config * Remove the need for separate `Delta*` and `Cumulative*` aggregate types * Return error earlier if readers are shut down * Log warning if two instruments have the same name with different casing * Log warning if view is created with empty criteria
Codecov ReportPatch coverage is 📢 Thoughts on this report? Let us know!. |
|
||
/// Checks whether aggregator has hit cardinality limit for metric streams | ||
pub(crate) fn is_under_cardinality_limit(size: usize) -> bool { | ||
size < STREAM_CARDINALITY_LIMIT as usize - 1 |
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.
Why we -1
here? Does it mean 1999 should return false
?
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 guess this was added in #1066. Return false for 1999, as the overflow measurements are aggregated in a separate metric stream. So total number of metric streams remain 2000.
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.
yeah this one is also unchanged from before (aside from removing the unused &self
param)
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.
Got it. We should probably add it to comment to make it clearer
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.
One nit otherwise looks good to me
Changes
This simplifies memory reuse on subsequent collection cycles.
Also small ergonomics changes:
MetricsProducer
config to builders to match other configDelta*
andCumulative*
aggregate typesMerge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes