public interface EventProcessor
extends java.io.Closeable
Application code normally does not need to interact with this interface. It is provided to allow a custom implementation or test fixture to be substituted for the SDK's normal analytics event logic.
Modifier and Type | Field and Description |
---|---|
static int |
NO_VERSION
|
Modifier and Type | Method and Description |
---|---|
void |
flush()
Specifies that any buffered events should be sent as soon as possible, rather than waiting
for the next flush interval.
|
void |
recordCustomEvent(LDContext context,
java.lang.String eventKey,
LDValue data,
java.lang.Double metricValue)
Creates a custom event, as when the SDK's
track method is called. |
void |
recordEvaluationEvent(LDContext context,
java.lang.String flagKey,
int flagVersion,
int variation,
LDValue value,
EvaluationReason reason,
LDValue defaultValue,
java.lang.String prerequisiteOfFlagKey,
boolean requireFullEvent,
java.lang.Long debugEventsUntilDate,
boolean excludeFromSummaries,
java.lang.Long samplingRatio)
Records the action of evaluating a feature flag.
|
void |
recordIdentifyEvent(LDContext context)
Registers an evaluation context, as when the SDK's
identify method is called. |
void |
recordMigrationEvent(MigrationOpTracker tracker)
Creates a migration event when the SDK's
trackMigration method is called. |
static final int NO_VERSION
void recordEvaluationEvent(LDContext context, java.lang.String flagKey, int flagVersion, int variation, LDValue value, EvaluationReason reason, LDValue defaultValue, java.lang.String prerequisiteOfFlagKey, boolean requireFullEvent, java.lang.Long debugEventsUntilDate, boolean excludeFromSummaries, java.lang.Long samplingRatio)
Depending on the feature flag properties and event properties, this may be transmitted to the events service as an individual event, or may only be added into summary data.
context
- the evaluation contextflagKey
- key of the feature flag that was evaluatedflagVersion
- the version of the flag, or NO_VERSION
if the flag was not foundvariation
- the result variation index, or EvaluationDetail.NO_VARIATION
if evaluation failedvalue
- the result valuereason
- the evaluation reason, or null if the reason was not requesteddefaultValue
- the default value parameter for the evaluationprerequisiteOfFlagKey
- the key of the flag that this flag was evaluated as a prerequisite of,
or null if this flag was evaluated for itselfrequireFullEvent
- true if full-fidelity analytics events should be sent for this flagdebugEventsUntilDate
- if non-null, debug events are to be generated until this millisecond timeexcludeFromSummaries
- true if the event evaluation should not be included in summariessamplingRatio
- ratio used to control event samplingvoid recordIdentifyEvent(LDContext context)
identify
method is called.context
- the evaluation contextvoid recordCustomEvent(LDContext context, java.lang.String eventKey, LDValue data, java.lang.Double metricValue)
track
method is called.context
- the evaluation contexteventKey
- the event keydata
- optional custom data provided for the event, may be null or LDValue.ofNull()
if not usedmetricValue
- optional numeric metric value provided for the event, or nullvoid recordMigrationEvent(MigrationOpTracker tracker)
trackMigration
method is called.tracker
- Migration tracker which was used to track details of the migration operation.void flush()
Closeable.close()
will synchronously deliver
any events that were not yet delivered prior to shutting down.