Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
prepare 1.2.0 release (#8)
Browse files Browse the repository at this point in the history
## [1.2.0] - 2023-10-11
### Added:
- Added support for the migration operation event.
- Added support for event sampling for feature events and migration
operation events.

---------

Co-authored-by: Eli Bishop <[email protected]>
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
Co-authored-by: Todd Anderson <[email protected]>
Co-authored-by: tanderson-ld <[email protected]>
Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com>
Co-authored-by: Kane Parkinson <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
  • Loading branch information
8 people authored Oct 11, 2023
1 parent 53b3600 commit cce01cb
Show file tree
Hide file tree
Showing 9 changed files with 1,042 additions and 49 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ jobs:
command: choco uninstall -y openjdk
- run:
name: install OpenJDK
command: choco install openjdk --version <<parameters.openjdk-version>>
command: choco install openjdk --version <<parameters.openjdk-version>> -y
- attach_workspace:
at: build
- run:
name: run tests
command: |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
.\gradlew.bat --no-daemon test # must use --no-daemon because CircleCI in Windows will hang if there's a daemon running
- run:
name: save test results
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Repository Maintainers
* @launchdarkly/team-sdk
* @launchdarkly/team-sdk-java
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,16 @@ private void processEvent(Event e, EventBuffer outbox) {
return;
}

// For migration events we process them and exit early. They cannot generate additional event types or be
// summarized.
if(e instanceof Event.MigrationOp) {
Event.MigrationOp me = (Event.MigrationOp)e;
if (Sampler.shouldSample(me.getSamplingRatio())) {
outbox.add(e);
}
return;
}

LDContext context = e.getContext();
if (context == null) {
return; // LDClient should never give us an event with no context
Expand All @@ -531,7 +541,9 @@ private void processEvent(Event e, EventBuffer outbox) {

if (e instanceof Event.FeatureRequest) {
Event.FeatureRequest fe = (Event.FeatureRequest)e;
outbox.addToSummary(fe);
if(!fe.isExcludeFromSummaries()) {
outbox.addToSummary(fe);
}
addFullEvent = fe.isTrackEvents();
if (shouldDebugEvent(fe)) {
debugEvent = fe.toDebugEvent();
Expand Down Expand Up @@ -562,10 +574,10 @@ private void processEvent(Event e, EventBuffer outbox) {
Event.Index ie = new Event.Index(e.getCreationDate(), e.getContext());
outbox.add(ie);
}
if (addFullEvent) {
if (addFullEvent && Sampler.shouldSample(e.getSamplingRatio())) {
outbox.add(e);
}
if (debugEvent != null) {
if (debugEvent != null && Sampler.shouldSample(e.getSamplingRatio())) {
outbox.add(debugEvent);
}
}
Expand Down
Loading

0 comments on commit cce01cb

Please sign in to comment.