-
Notifications
You must be signed in to change notification settings - Fork 224
refactor and optimize downsampling interceptor #2097
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
base: main
Are you sure you want to change the base?
Conversation
3429670 to
0efb3f3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2097 +/- ##
==========================================
+ Coverage 70.89% 70.93% +0.04%
==========================================
Files 373 375 +2
Lines 63127 63243 +116
==========================================
+ Hits 44751 44861 +110
- Misses 18376 18382 +6 ☔ View full report in Codecov by Sentry. |
oteffahi
left a 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.
LGTM.
Left a few nitpick comments.
| flow: InterceptorFlow, | ||
| #[cfg(feature = "stats")] stats: Arc<TransportStats>, | ||
| ) -> Self { | ||
| let mut ke_id = KeBoxTree::default(); |
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.
For future reference: we should move the computation of the key-expr tree outside of the interceptor, and wrap it in an Arc in order to reuse the same tree for both Ingree/Egress interceptors constructed from the same Interceptor Factory.
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.
For future reference
Yes, because I don't want to do it now
| match msg.body { | ||
| NetworkBodyMut::Push(Push { payload, .. }) => match payload { | ||
| PushBody::Put(_) => self.put, | ||
| PushBody::Del(_) => self.delete, | ||
| }, | ||
| NetworkBodyMut::Request(_) => self.query, | ||
| NetworkBodyMut::Response(_) => self.reply, | ||
| _ => 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.
The match with all enum variants was intentional to cause a compile-time error if the enum is ever changed. IMO we should keep that.
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.
Done
No description provided.