-
Notifications
You must be signed in to change notification settings - Fork 20
[FSSDK-11177] Decision Service CMAB + Optimizely Client + Impression event adjustment #394
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: master
Are you sure you want to change the base?
[FSSDK-11177] Decision Service CMAB + Optimizely Client + Impression event adjustment #394
Conversation
OptimizelySDK/Bucketing/Bucketer.cs
Outdated
| /// <param name="userId">User identifier</param> | ||
| /// <param name="trafficAllocations">Traffic allocations to use for bucketing</param> | ||
| /// <returns>Entity ID (string) if user is bucketed, null otherwise</returns> | ||
| public virtual Result<string> BucketToEntityId(ProjectConfig config, Experiment experiment, |
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 can accept ExperimentCore parameter, and reuse the part upto BucketToEntityId for the Bucket metheod below. Logic for bucket would be:
- get entityId by calling BucketToEntityId()
- get the variation from the config and return using the entityId from step 1
|
|
||
| if (config.CustomCache != null) | ||
| { | ||
| _cmabCache = config.CustomCache as LruCache<CmabCacheEntry>; |
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 should not assume that customCache must be LruCache. It could be any implementation
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 class field _cmabCache should also be of type ICache<>, not LruCache
| /// <param name="cmabConfig">Configuration for CMAB cache. If null, default values are used.</param> | ||
| /// <param name="cmabClient">Client for fetching decisions from the CMAB prediction service. If null, a default client is created.</param> | ||
| /// <param name="logger">Optional logger for recording service operations.</param> | ||
| public DefaultCmabService(CmabConfig cmabConfig = null, |
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.
instead of taking in the config here, we can take in a ICache<> here and push the resposibility of supplying the cache to the caller, similar to cmabClient
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 see all of them can be null. We can just make them required and put the construction responsibility to the caller
Summary
Test Plan
Issues