Package backtraceio.library.interfaces
Interface Metrics
-
- All Known Implementing Classes:
BacktraceMetrics
public interface Metrics
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddSummedEvent(java.lang.String metricGroupName)Adds a summed event to the outgoing queue.booleanaddSummedEvent(java.lang.String metricGroupName, java.util.Map<java.lang.String,java.lang.Object> attributes)Adds a summed event to the outgoing queue.booleanaddUniqueEvent(java.lang.String name)Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user.booleanaddUniqueEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attributes)Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user.intcount()Return the total number of events in storevoidenable()Enables metrics with BacktraceClient's credentials.voidenable(BacktraceMetricsSettings settings)Enable metricsvoidenable(BacktraceMetricsSettings settings, java.lang.String defaultUniqueEventName)Enable metricsvoidenable(java.lang.String defaultUniqueEventName)Enables metrics with BacktraceClient's credentials and a custom session user identifier.java.util.concurrent.ConcurrentLinkedDeque<SummedEvent>getSummedEvents()Get the pending list of summed eventsjava.util.concurrent.ConcurrentLinkedDeque<UniqueEvent>getUniqueEvents()Get the pending list of unique eventsvoidsend()Send all outgoing messages (unique and summed) currently queuedvoidsendStartupEvent()Send the startup eventvoidsetMaximumNumberOfEvents(int maximumNumberOfEvents)Set the maximum number of events to store.voidsetSummedEventsOnServerResponse(EventsOnServerResponseEventListener callback)Custom callback to be executed on server response to a summed events submission requestvoidsetSummedEventsRequestHandler(EventsRequestHandler eventsRequestHandler)Custom request handler for sending Backtrace summed events to servervoidsetUniqueEventsOnServerResponse(EventsOnServerResponseEventListener callback)Custom callback to be executed on server response to a unique events submission requestvoidsetUniqueEventsRequestHandler(EventsRequestHandler eventsRequestHandler)Custom request handler for sending Backtrace unique events to server
-
-
-
Method Detail
-
enable
void enable()
Enables metrics with BacktraceClient's credentials.
-
enable
void enable(java.lang.String defaultUniqueEventName)
Enables metrics with BacktraceClient's credentials and a custom session user identifier.- Parameters:
defaultUniqueEventName- custom session user identifier
-
enable
void enable(BacktraceMetricsSettings settings)
Enable metrics- Parameters:
settings- for Backtrace metrics
-
enable
void enable(BacktraceMetricsSettings settings, java.lang.String defaultUniqueEventName)
Enable metrics- Parameters:
settings- for Backtrace metricsdefaultUniqueEventName- custom session user identifier
-
send
void send()
Send all outgoing messages (unique and summed) currently queued
-
addUniqueEvent
boolean addUniqueEvent(java.lang.String name)
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
boolean addUniqueEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attributes)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
java.util.concurrent.ConcurrentLinkedDeque<UniqueEvent> getUniqueEvents()
Get the pending list of unique events- Returns:
- list of pending unique events to send
-
addSummedEvent
boolean addSummedEvent(java.lang.String metricGroupName)
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:
BacktraceMetrics.send()
-
addSummedEvent
boolean addSummedEvent(java.lang.String metricGroupName, java.util.Map<java.lang.String,java.lang.Object> attributes)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:
BacktraceMetrics.send()
-
getSummedEvents
java.util.concurrent.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
void setUniqueEventsRequestHandler(EventsRequestHandler eventsRequestHandler)
Custom request handler for sending Backtrace unique events to server- Parameters:
eventsRequestHandler- object with method which will be executed
-
setSummedEventsRequestHandler
void setSummedEventsRequestHandler(EventsRequestHandler eventsRequestHandler)
Custom request handler for sending Backtrace summed events to server- Parameters:
eventsRequestHandler- object with method which will be executed
-
setUniqueEventsOnServerResponse
void setUniqueEventsOnServerResponse(EventsOnServerResponseEventListener callback)
Custom callback to be executed on server response to a unique events submission request- Parameters:
callback- object with method which will be executed
-
setSummedEventsOnServerResponse
void setSummedEventsOnServerResponse(EventsOnServerResponseEventListener callback)
Custom callback to be executed on server response to a summed events submission request- Parameters:
callback- object with method which will be executed
-
-