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 TypeMethodDescriptionvoid
record
(AnalyticsEvent event) Record an analytics event.default void
record
(AnalyticsPriority priority, String type, Object data, Class<?> view) Record an analytics event with the specified settings.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.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 defaultAnalyticsEvent.View
json view to serialize data.default void
recordHigh
(String type, Object data, Class<?> view) Record an analytics event with HIGH prioritydefault void
Record an analytics event with LOW priority and defaultAnalyticsEvent.View
json view to serialize data.default void
Record an analytics event with LOW prioritydefault void
recordMedium
(String type, Object data) Record an analytics event with MEDIUM priority and defaultAnalyiticsEvent.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
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 userecordAsync()
which queues the event to be recorded by a background thread.- Parameters:
event
- the event to record
-
recordAsync
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
Record an analytics event with the specified settings.- Parameters:
priority
- priority of the eventtype
- event typedata
- data for the eventview
- json view class for data serialization
-
recordAsync
Asynchronously record an analytics event with the specified settings.- Parameters:
priority
- priority of the eventtype
- event typedata
- data for the eventview
- json view class for data serialization
-
recordHigh
Record an analytics event with HIGH priority- Parameters:
type
- event typedata
- data for the eventview
- json view class for data serialization
-
recordHigh
Record an analytics event with HIGH priority and defaultAnalyticsEvent.View
json view to serialize data.- Parameters:
type
- event typedata
- data for the event
-
recordMedium
Record an analytics event with MEDIUM priority- Parameters:
type
- event typedata
- data for the eventview
- json view class for data serialization
-
recordMedium
Record an analytics event with MEDIUM priority and defaultAnalyiticsEvent.View
json view to serialize data.- Parameters:
type
- event typedata
- data for the event
-
recordLow
Record an analytics event with LOW priority- Parameters:
type
- event typedata
- data for the eventview
- json view class for data serialization
-
recordLow
Record an analytics event with LOW priority and defaultAnalyticsEvent.View
json view to serialize data.- Parameters:
type
- event typedata
- data for the event
-