-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Cache hooks per Flag Evaluation Type #1734
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
Signed-off-by: christian.lutnik <[email protected]>
Signed-off-by: christian.lutnik <[email protected]>
# Conflicts: # src/test/java/dev/openfeature/sdk/benchmark/AllocationBenchmark.java
Signed-off-by: christian.lutnik <[email protected]>
Signed-off-by: christian.lutnik <[email protected]>
Signed-off-by: christian.lutnik <[email protected]>
Signed-off-by: christian.lutnik <[email protected]>
Signed-off-by: christian.lutnik <[email protected]>
Signed-off-by: christian.lutnik <[email protected]>
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1734 +/- ##
============================================
+ Coverage 92.47% 93.39% +0.92%
- Complexity 527 548 +21
============================================
Files 52 53 +1
Lines 1276 1333 +57
Branches 112 129 +17
============================================
+ Hits 1180 1245 +65
+ Misses 60 50 -10
- Partials 36 38 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aepfli
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.
i am torn a little bit and not 100% convinced, that this will make things easier. maybe we should think about v2 and rethink our hooksupport api overall.
But i also do not have big remarks to add
| */ | ||
| public List<Hook> getHooks() { | ||
| return new ArrayList<>(this.apiHooks); | ||
| // Hooks can be duplicated if they support multiple FlagValueTypes |
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 am not sure, the order of hooks is important, i know that you are now using other methods, to retrieve the needed hooks, but can this implementation now be a problem, because we are not keeping the order of the hooks. Now we merge multiple hook source after each other.
| @Override | ||
| public OpenFeatureClient addHooks(Hook... hooks) { | ||
| this.clientHooks.addAll(Arrays.asList(hooks)); | ||
| var types = FlagValueType.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.
[suggestion] seems like this block of code repeats itself, should this maybe be a static helper function?





Hooks are now stored in a map to allow efficient lookup of hooks supporting certain FlagValueTypes. This and other changes makes merging the hooks cheaper.
Related Issues
Part of #1718
Follow Up Tasks
Implement efficient Hook Storage in all providers (optional, but will speed things up)