Package backtraceio.library.interfaces
Interface Metrics
- All Known Implementing Classes:
BacktraceMetrics
public interface Metrics
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addSummedEvent
(String metricGroupName) Adds a summed event to the outgoing queue.boolean
addSummedEvent
(String metricGroupName, Map<String, Object> attributes) Adds a summed event to the outgoing queue.boolean
addUniqueEvent
(String name) Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user.boolean
addUniqueEvent
(String name, Map<String, Object> attributes) Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user.int
count()
Return the total number of events in storevoid
enable()
Enables metrics with BacktraceClient's credentials.void
enable
(BacktraceMetricsSettings settings) Enable metricsvoid
enable
(BacktraceMetricsSettings settings, String defaultUniqueEventName) Enable metricsvoid
Enables metrics with BacktraceClient's credentials and a custom session user identifier.Get the pending list of summed eventsGet the pending list of unique eventsvoid
send()
Send all outgoing messages (unique and summed) currently queuedvoid
Send the startup eventvoid
setMaximumNumberOfEvents
(int maximumNumberOfEvents) Set the maximum number of events to store.void
Custom callback to be executed on server response to a summed events submission requestvoid
setSummedEventsRequestHandler
(EventsRequestHandler eventsRequestHandler) Custom request handler for sending Backtrace summed events to servervoid
Custom callback to be executed on server response to a unique events submission requestvoid
setUniqueEventsRequestHandler
(EventsRequestHandler eventsRequestHandler) Custom request handler for sending Backtrace unique events to server
-
Method Details
-
enable
void enable()Enables metrics with BacktraceClient's credentials. -
enable
Enables metrics with BacktraceClient's credentials and a custom session user identifier.- Parameters:
defaultUniqueEventName
- custom session user identifier
-
enable
Enable metrics- Parameters:
settings
- for Backtrace metrics
-
enable
Enable metrics- Parameters:
settings
- for Backtrace metricsdefaultUniqueEventName
- custom session user identifier
-
send
void send()Send all outgoing messages (unique and summed) currently queued -
addUniqueEvent
Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user. This list is persistent, meaning that events will not be removed upon Send(), as they are for summed events. For non-standard unique events, server side configuration needs to be done. Please refer to the online documentation at https://support.backtrace.io- Parameters:
name
- the name of the Unique event- Returns:
- true if added successfully, otherwise false.
-
addUniqueEvent
Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user. This list is persistent, meaning that events will not be removed upon Send(), as they are for summed events. For non-standard unique events, server side configuration needs to be done. Please refer to the online documentation at https://support.backtrace.io- Parameters:
name
- the name of the Unique eventattributes
- linked attributes which will update this unique event on update- Returns:
- true if added successfully, otherwise false.
-
getUniqueEvents
ConcurrentLinkedDeque<UniqueEvent> getUniqueEvents()Get the pending list of unique events- Returns:
- list of pending unique events to send
-
addSummedEvent
Adds a summed event to the outgoing queue.- Parameters:
metricGroupName
- name of the metric group to be incremented. This metric group must be configured on the server side as well. Please refer to the online documentation at https://support.backtrace.io- Returns:
- true if added successfully, otherwise false.
- See Also:
-
addSummedEvent
Adds a summed event to the outgoing queue.- Parameters:
metricGroupName
- name of the metric group to be incremented. This metric group must be configured on the server side as well. Please refer to the online documentation at https://support.backtrace.ioattributes
- Custom attributes to add. Will be merged with the default attributes, with attribute values provided here overriding any defaults.- Returns:
- true if added successfully, otherwise false.
- See Also:
-
getSummedEvents
ConcurrentLinkedDeque<SummedEvent> getSummedEvents()Get the pending list of summed events- Returns:
- list of pending summed events to send
-
setMaximumNumberOfEvents
void setMaximumNumberOfEvents(int maximumNumberOfEvents) Set the maximum number of events to store. Once the maximum is hit we will send events to the API- Parameters:
maximumNumberOfEvents
- Maximum number of events to store before sending events to the API
-
count
int count()Return the total number of events in store- Returns:
- Total number of events in store
-
sendStartupEvent
void sendStartupEvent()Send the startup event -
setUniqueEventsRequestHandler
Custom request handler for sending Backtrace unique events to server- Parameters:
eventsRequestHandler
- object with method which will be executed
-
setSummedEventsRequestHandler
Custom request handler for sending Backtrace summed events to server- Parameters:
eventsRequestHandler
- object with method which will be executed
-
setUniqueEventsOnServerResponse
Custom callback to be executed on server response to a unique events submission request- Parameters:
callback
- object with method which will be executed
-
setSummedEventsOnServerResponse
Custom callback to be executed on server response to a summed events submission request- Parameters:
callback
- object with method which will be executed
-