Interface AnalyticsService

All Known Implementing Classes:
AnalyticsClient, AnalyticsServer

public interface AnalyticsService
Interface for the analytics service. Both AnalyticsServer and AnalyticsClient implement this interface. Which service is actually used depends on whether the node is primary or not. While both implementations allow data to be recorded, the two implementations differ in the following ways:
  • client: Records analytic events and periodically transfers them to the server running on the primary server.
  • server: Records analytic events from all nodes in the device. Events are split into channels using user provided classifiers and channel data is exported via user provided exporters.
Since:
1.0
Version:
2024-03-12
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Record an analytics event.
    default void
    record(AnalyticsPriority priority, String type, Object data, Class<?> view)
    Record an analytics event with the specified settings.
    void
    Record an analytics event by putting it into a queue so that a background thread can perform data serialization and database writes decoupled from the calling thread.
    default void
    recordAsync(AnalyticsPriority priority, String type, Object data, Class<?> view)
    Asynchronously record an analytics event with the specified settings.
    default void
    recordHigh(String type, Object data)
    Record an analytics event with HIGH priority and default AnalyticsEvent.View json view to serialize data.
    default void
    recordHigh(String type, Object data, Class<?> view)
    Record an analytics event with HIGH priority
    default void
    recordLow(String type, Object data)
    Record an analytics event with LOW priority and default AnalyticsEvent.View json view to serialize data.
    default void
    recordLow(String type, Object data, Class<?> view)
    Record an analytics event with LOW priority
    default void
    recordMedium(String type, Object data)
    Record an analytics event with MEDIUM priority and default AnalyiticsEvent.View json view to serialize data.
    default void
    recordMedium(String type, Object data, Class<?> view)
    Record an analytics event with MEDIUM priority
  • Method Details

    • record

      void record(AnalyticsEvent event)
      Record an analytics event. This will perform all event processing in the calling thread. Normally this is nominal overhead, but for particularly time sensitive use cases use recordAsync() which queues the event to be recorded by a background thread.
      Parameters:
      event - the event to record
    • recordAsync

      void recordAsync(AnalyticsEvent event)
      Record an analytics event by putting it into a queue so that a background thread can perform data serialization and database writes decoupled from the calling thread. Care should be taken when providing live data as it can change between the call to queue the data and when the background thread serializes it. This method is intended for low latency code paths.
      Parameters:
      event - the event to record
    • record

      default void record(AnalyticsPriority priority, String type, Object data, Class<?> view)
      Record an analytics event with the specified settings.
      Parameters:
      priority - priority of the event
      type - event type
      data - data for the event
      view - json view class for data serialization
    • recordAsync

      default void recordAsync(AnalyticsPriority priority, String type, Object data, Class<?> view)
      Asynchronously record an analytics event with the specified settings.
      Parameters:
      priority - priority of the event
      type - event type
      data - data for the event
      view - json view class for data serialization
    • recordHigh

      default void recordHigh(String type, Object data, Class<?> view)
      Record an analytics event with HIGH priority
      Parameters:
      type - event type
      data - data for the event
      view - json view class for data serialization
    • recordHigh

      default void recordHigh(String type, Object data)
      Record an analytics event with HIGH priority and default AnalyticsEvent.View json view to serialize data.
      Parameters:
      type - event type
      data - data for the event
    • recordMedium

      default void recordMedium(String type, Object data, Class<?> view)
      Record an analytics event with MEDIUM priority
      Parameters:
      type - event type
      data - data for the event
      view - json view class for data serialization
    • recordMedium

      default void recordMedium(String type, Object data)
      Record an analytics event with MEDIUM priority and default AnalyiticsEvent.View json view to serialize data.
      Parameters:
      type - event type
      data - data for the event
    • recordLow

      default void recordLow(String type, Object data, Class<?> view)
      Record an analytics event with LOW priority
      Parameters:
      type - event type
      data - data for the event
      view - json view class for data serialization
    • recordLow

      default void recordLow(String type, Object data)
      Record an analytics event with LOW priority and default AnalyticsEvent.View json view to serialize data.
      Parameters:
      type - event type
      data - data for the event