-
Notifications
You must be signed in to change notification settings - Fork 3
feat: generate analytic events from evaluations #36
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
Conversation
|
This pull request has been linked to Shortcut Story #199609: Generate analytic events. |
c6b6af1 to
9ac9564
Compare
apps/hello-cpp/main.cpp
Outdated
| << "Value was: " << detail_val.first; | ||
| } | ||
| std::this_thread::sleep_for(std::chrono::seconds(1)); | ||
| } |
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.
Maybe we need main_casey.cpp and main_ryan.cpp
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.
Maybe we will eventually accidentally make a useful app.
| // TODO: SC-199918 | ||
| auto error_reason = EvaluationReason("CLIENT_NOT_READY"); | ||
| if (eval_reasons_available_) { | ||
| event.reason = error_reason; |
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'm copying the if (reasons) part from the Go client SDK, but I'm not sure the justification and I might have it wrong - will check other SDKs. The spec says:
The reason property is only set if any of the following is true:
The application used the VariationDetail operation rather than Variation.
For server-side SDKs, any of the conditions described in the previous “for server-side SDKs” bullet list are true.
For client-side SDKs, the flag’s trackReasons property is true.
So I'd think it should only be set if flag.track_reason() or if detailed is true. Now, we can't use the former because the flag isn't present, so then it's up to detailed. But the Go SDK is using the fact that the user requested withReasons...
| return std::nullopt; | ||
| } | ||
|
|
||
| auto events = boost::json::value_from(outbox_.Consume()); |
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.
This was a bug; it wouldn't send any summary event if the outbox was full. Now it properly sends summary events if they exist.
Stops infinite recursion from occuring when comparing these types.
…enerate-analytic-events
| namespace launchdarkly { | ||
|
|
||
| template <typename T> | ||
| class EvaluationDetail { |
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 think we should have some docs on this type, being as it is returned by the public API.
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.
Fair point.
This PR generates feature events when
Variationmethods are called. I've also added detailed evaluations.There is still work to be done here, mainly in:
VariationInternal(it's long, and pretty messy)Valueto facilitate conversion to primitive types.