Class EventProcessorBuilder
- java.lang.Object
-
- com.launchdarkly.sdk.android.integrations.EventProcessorBuilder
-
- All Implemented Interfaces:
ComponentConfigurer<EventProcessor>
public abstract class EventProcessorBuilder extends java.lang.Object implements ComponentConfigurer<EventProcessor>
Contains methods for configuring delivery of analytics events.The SDK normally buffers analytics events and sends them to LaunchDarkly at intervals. If you want to customize this behavior, create a builder with
Components.sendEvents()
, change its properties with the methods of this class, and pass it toLDConfig.Builder.events(ComponentConfigurer)
:LDConfig config = new LDConfig.Builder() .events(Components.sendEvents().capacity(500).flushIntervalMillis(2000)) .build();
Note that this class is abstract; the actual implementation is created by calling
Components.sendEvents()
.- Since:
- 3.3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allAttributesPrivate
protected int
capacity
static int
DEFAULT_CAPACITY
The default value forcapacity(int)
.static int
DEFAULT_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
The default value fordiagnosticRecordingIntervalMillis(int)
: 15 minutes.static int
DEFAULT_FLUSH_INTERVAL_MILLIS
The default value forflushIntervalMillis(int)
: 30 seconds.protected int
diagnosticRecordingIntervalMillis
protected int
flushIntervalMillis
static int
MIN_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
The minimum value fordiagnosticRecordingIntervalMillis(int)
: 5 minutes.protected java.util.Set<AttributeRef>
privateAttributes
-
Constructor Summary
Constructors Constructor Description EventProcessorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventProcessorBuilder
allAttributesPrivate(boolean allAttributesPrivate)
Sets whether or not all optional context attributes should be hidden from LaunchDarkly.EventProcessorBuilder
capacity(int capacity)
Set the capacity of the events buffer.EventProcessorBuilder
diagnosticRecordingIntervalMillis(int diagnosticRecordingIntervalMillis)
Sets the interval at which periodic diagnostic data is sent.EventProcessorBuilder
flushIntervalMillis(int flushIntervalMillis)
Sets the interval between flushes of the event buffer.EventProcessorBuilder
privateAttributes(java.lang.String... attributeNames)
Marks a set of attribute names or subproperties as private.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.launchdarkly.sdk.android.subsystems.ComponentConfigurer
build
-
-
-
-
Field Detail
-
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY
The default value forcapacity(int)
.- See Also:
- Constant Field Values
-
DEFAULT_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
public static final int DEFAULT_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
The default value fordiagnosticRecordingIntervalMillis(int)
: 15 minutes.- See Also:
- Constant Field Values
-
DEFAULT_FLUSH_INTERVAL_MILLIS
public static final int DEFAULT_FLUSH_INTERVAL_MILLIS
The default value forflushIntervalMillis(int)
: 30 seconds.- See Also:
- Constant Field Values
-
MIN_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
public static final int MIN_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
The minimum value fordiagnosticRecordingIntervalMillis(int)
: 5 minutes.- See Also:
- Constant Field Values
-
allAttributesPrivate
protected boolean allAttributesPrivate
-
capacity
protected int capacity
-
diagnosticRecordingIntervalMillis
protected int diagnosticRecordingIntervalMillis
-
flushIntervalMillis
protected int flushIntervalMillis
-
privateAttributes
protected java.util.Set<AttributeRef> privateAttributes
-
-
Method Detail
-
allAttributesPrivate
public EventProcessorBuilder allAttributesPrivate(boolean allAttributesPrivate)
Sets whether or not all optional context attributes should be hidden from LaunchDarkly.If this is
true
, all context attribute values (other than the key) will be private, not just the attributes specified inprivateAttributes(String...)
. By default, it isfalse
.- Parameters:
allAttributesPrivate
- true if all context attributes should be private- Returns:
- the builder
- See Also:
privateAttributes(String...)
-
capacity
public EventProcessorBuilder capacity(int capacity)
Set the capacity of the events buffer.The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed (see
flushIntervalMillis(int)
, events will be discarded. Increasing the capacity means that events are less likely to be discarded, at the cost of consuming more memory.The default value is
DEFAULT_CAPACITY
.- Parameters:
capacity
- the capacity of the event buffer- Returns:
- the builder
-
diagnosticRecordingIntervalMillis
public EventProcessorBuilder diagnosticRecordingIntervalMillis(int diagnosticRecordingIntervalMillis)
Sets the interval at which periodic diagnostic data is sent.The default value is
DEFAULT_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
; the minimum value isMIN_DIAGNOSTIC_RECORDING_INTERVAL_MILLIS
. This property is ignored ifLDConfig.Builder.diagnosticOptOut(boolean)
is set totrue
.- Parameters:
diagnosticRecordingIntervalMillis
- the diagnostics interval in milliseconds- Returns:
- the builder
-
flushIntervalMillis
public EventProcessorBuilder flushIntervalMillis(int flushIntervalMillis)
Sets the interval between flushes of the event buffer.Decreasing the flush interval means that the event buffer is less likely to reach capacity.
The default value is
DEFAULT_FLUSH_INTERVAL_MILLIS
.- Parameters:
flushIntervalMillis
- the flush interval in milliseconds- Returns:
- the builder
-
privateAttributes
public EventProcessorBuilder privateAttributes(java.lang.String... attributeNames)
Marks a set of attribute names or subproperties as private.Any contexts sent to LaunchDarkly with this configuration active will have attributes with these names removed. This is in addition to any attributes that were marked as private for an individual context with
ContextBuilder
methods.This method replaces any previous private attributes that were set on the same builder, rather than adding to them.
- Parameters:
attributeNames
- a set of attribute names that will be removed from context data set to LaunchDarkly- Returns:
- the builder
- See Also:
allAttributesPrivate(boolean)
-
-