Class DiagnosticStore
- java.lang.Object
-
- com.launchdarkly.sdk.internal.events.DiagnosticStore
-
public final class DiagnosticStore extends java.lang.ObjectImplementation of basic diagnostic event creation. Platform-specific details are provided in SdkDiagnosticParams.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiagnosticStore.SdkDiagnosticParamsParameters for creating a DiagnosticStore.
-
Constructor Summary
Constructors Constructor Description DiagnosticStore(DiagnosticStore.SdkDiagnosticParams params)Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DiagnosticEventcreateEventAndReset(long droppedEvents, long deduplicatedContexts)Creates a statistics event and then resets the counters.longgetDataSinceDate()Returns the millisecond timestamp when the current diagnostic stats began.com.launchdarkly.sdk.internal.events.DiagnosticIdgetDiagnosticId()Returns the unique diagnostic identifier.DiagnosticEventgetInitEvent()Returns the initial diagnostic event as a JSON object.voidrecordEventsInBatch(int eventsInBatch)Records the number of events in the last flush payload.voidrecordStreamInit(long timestamp, long durationMillis, boolean failed)Records a successful or failed stream initialization.
-
-
-
Constructor Detail
-
DiagnosticStore
public DiagnosticStore(DiagnosticStore.SdkDiagnosticParams params)
Constructs an instance.- Parameters:
params- the diagnostic properties
-
-
Method Detail
-
getDiagnosticId
public com.launchdarkly.sdk.internal.events.DiagnosticId getDiagnosticId()
Returns the unique diagnostic identifier.- Returns:
- the identifier
-
getDataSinceDate
public long getDataSinceDate()
Returns the millisecond timestamp when the current diagnostic stats began.- Returns:
- the timestamp
-
getInitEvent
public DiagnosticEvent getInitEvent()
Returns the initial diagnostic event as a JSON object.- Returns:
- the initial event
-
recordStreamInit
public void recordStreamInit(long timestamp, long durationMillis, boolean failed)Records a successful or failed stream initialization.- Parameters:
timestamp- the millisecond timestampdurationMillis- how long the initialization tookfailed- true if failed
-
recordEventsInBatch
public void recordEventsInBatch(int eventsInBatch)
Records the number of events in the last flush payload.- Parameters:
eventsInBatch- the event count
-
createEventAndReset
public DiagnosticEvent createEventAndReset(long droppedEvents, long deduplicatedContexts)
Creates a statistics event and then resets the counters.- Parameters:
droppedEvents- number of dropped eventsdeduplicatedContexts- number of deduplicated contexts- Returns:
- the event
-
-