-
Notifications
You must be signed in to change notification settings - Fork 45
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
Improve efficiency of ETW metrics exporter #134
Improve efficiency of ETW metrics exporter #134
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
=======================================
- Coverage 54.1% 53.9% -0.2%
=======================================
Files 42 42
Lines 6282 6153 -129
=======================================
- Hits 3400 3320 -80
+ Misses 2882 2833 -49 ☔ View full report in Codecov by Sentry. |
Comparing the latest |
With a more realistic |
We noticed some Thus, this comment is not blocking as the change is unrelated to this PR, but we propose making those proto types more generic, thus we prevent future confusions regarding tonic usage or not. |
…buffer in emit_export_metric_service_request
I borrowed the |
…ations to avoid repeat allocations as much as possible
|
||
for _i in 0..iters { | ||
runtime.block_on(async { | ||
export(&exporter, &mut resource_metrics).await; |
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.
It might be better to micro benchmark just the serialization and export of one data point instead of 20000. It would keep the calculations simple when comparing two benchmark results.
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 this is coming from - #134 (comment)
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, let me know if there's a preference between a micro benchmark and what Cijo suggested.
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.
not a blocker. Exporting Metrics is not in hot path, so it may not be worth perfecting this.
if let Some(proto_data) = proto_data { | ||
match proto_data { | ||
TonicMetricData::Histogram(hist) => { | ||
for data_point in hist.data_points { |
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.
The contents of each arm looks repetitive. Can this be factored into a function? It would help also to improve readability and maintainability.
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.
There is repetition that could probably be reduced and I'm open to suggestions. I don't see a clean way to abstract the repetitive logic into a function because specialization is needed to construct data points of different metric data types. We could probably add traits that allow for better abstraction, but I'm not sure I want to attempt that here.
Fixes #104
Design Decisions:
ResourceMetrics
for each metric point and serialize each into an exportable bufferChanges
Please provide a brief description of the changes here.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes