-
Notifications
You must be signed in to change notification settings - Fork 13
Fix tracking callback invocation #135
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?
Fix tracking callback invocation #135
Conversation
…eriment and experiment result for tracking callback invocation
# Conflicts: # lib/src/main/java/growthbook/sdk/java/evaluators/FeatureEvaluator.java
|
||
// Add the experiment to the tracker if it doesn't exist. | ||
if (!experimentTracker.isExperimentTracked(key)) { | ||
experimentTracker.trackExperiment(key); |
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.
We use an Experiment Tracker to keep track of the most recent experiments set with a bounded max val of 30(which can be changed). Changing this implementation to a unbounded hashSet will grow significantly when there are multiple instances of GrowthBookClient is created.
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.
We’ve restored your implementation of the Experiment Tracker as suggested.
@@ -157,6 +157,7 @@ public Options(@Nullable Boolean enabled, | |||
@Nullable | |||
private Map<String, Object> globalForcedFeatureValues; | |||
|
|||
private ExperimentHelper experimentHelper = new ExperimentHelper(); |
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.
Options
is not a place for initializing experimentHelper. Options technically provides all configurable parameters that influence the behavior of GrowthBook instance.
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.
Ok, we have moved the Experiment Tracker to the Global Context. We need this instance to be a singleton in order to track experiments and their results properly — only once. Previously, it was being recreated during every evaluation process
…cker to GlobalContext to make it singleton, remove ExperimentHelper from Options class
…eriment and experiment result for tracking callback invocation