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 boolean
addSummedEvent(java.lang.String metricGroupName)
Adds a summed event to the outgoing queue.boolean
addSummedEvent(java.lang.String metricGroupName, java.util.Map<java.lang.String,java.lang.Object> attributes)
Adds a summed event to the outgoing queue.boolean
addUniqueEvent(java.lang.String name)
Add a unique event, such as UserID, SteamID and other attributes that uniquely identify a user.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.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, java.lang.String defaultUniqueEventName)
Enable metricsvoid
enable(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 eventsvoid
send()
Send all outgoing messages (unique and summed) currently queuedvoid
sendStartupEvent()
Send the startup eventvoid
setMaximumNumberOfEvents(int maximumNumberOfEvents)
Set the maximum number of events to store.void
setSummedEventsOnServerResponse(EventsOnServerResponseEventListener callback)
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
setUniqueEventsOnServerResponse(EventsOnServerResponseEventListener callback)
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 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
-
-