Class DiagnosticStore


  • public final class DiagnosticStore
    extends java.lang.Object
    Implementation of basic diagnostic event creation. Platform-specific details are provided in SdkDiagnosticParams.
    • 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 timestamp
        durationMillis - how long the initialization took
        failed - 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 events
        deduplicatedContexts - number of deduplicated contexts
        Returns:
        the event