Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions client/src/main/java/cloud/prefab/client/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public enum OnInitializationFailure {
private boolean contextShapeUploadEnabled = true;
private boolean evaluatedConfigKeyUploadEnabled = true;

private boolean configEvaluationCountsUploadEnabled = false;

public Options() {
this.apikey = System.getenv("PREFAB_API_KEY");
this.prefabApiUrl =
Expand Down Expand Up @@ -209,6 +211,17 @@ public boolean isEvaluatedConfigKeyUploadEnabled() {
return evaluatedConfigKeyUploadEnabled;
}

public boolean isConfigEvaluationCountsUploadEnabled() {
return configEvaluationCountsUploadEnabled;
}

public Options setConfigEvaluationCountsUploadEnabled(
boolean configEvaluationCountsUploadEnabled
) {
this.configEvaluationCountsUploadEnabled = configEvaluationCountsUploadEnabled;
return this;
}

/**
* Configure client to report context shape data
* The captured data consists of names and types of context data, NOT the actual values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.time.Clock;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -162,8 +161,10 @@ public ConfigClientImpl(
new EvaluatedKeysAggregator(options, prefabHttpClient, Clock.systemUTC());
evaluatedKeysAggregator.start();
}
matchProcessingManager = new MatchProcessingManager(prefabHttpClient, options);
matchProcessingManager.start();
if (options.isConfigEvaluationCountsUploadEnabled()) {
matchProcessingManager = new MatchProcessingManager(prefabHttpClient, options);
matchProcessingManager.start();
}
}
}

Expand Down