-
Notifications
You must be signed in to change notification settings - Fork 41
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
perf: improve error handling #739
Conversation
Signed-off-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #739 +/- ##
============================================
+ Coverage 94.86% 95.10% +0.23%
- Complexity 365 367 +2
============================================
Files 33 34 +1
Lines 857 858 +1
Branches 53 53
============================================
+ Hits 813 816 +3
+ Misses 23 22 -1
+ Partials 21 20 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Do we need the stack trace on any OpenFeatureError?
src/main/java/dev/openfeature/sdk/exceptions/FlagNotFoundError.java
Outdated
Show resolved
Hide resolved
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.
Agree with this. Just see here.
Signed-off-by: Giovanni Liva <giovanni.liva@dynatrace.com>
We have cases where consumers do things like: catch (IOException e) {
throw new GeneralError("Something bad happend", e);
} Here, |
@toddbaert the suggested |
@thisthat Yes, I understand that. I was making a point relative to @beeme1mr 's question:
My concern is that if we do what you've done here for other exceptions which are more complicated than |
|
This PR
While working with OF, I noticed that in case a flag is not found, the whole stack trace is attached to the exception.
I think this info is not necessary for this type of exception since it is hidden from the end user, and the SDK only requires the
ErrorCode
field.I quickly configured some JMH tests that use the InMemory FlagD provider to test the performance gains in evaluating a flag that doesn't exist. The Score value represents the amount of FF evaluations done in a single millisecond.
In a single thread case, the performance gain is >60%.
Before
After