Interface Metrics

All Known Implementing Classes:
BacktraceMetrics

public interface Metrics
  • Method Details

    • enable

      void enable()
      Enables metrics with BacktraceClient's credentials.
    • enable

      void enable(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, String defaultUniqueEventName)
      Enable metrics
      Parameters:
      settings - for Backtrace metrics
      defaultUniqueEventName - custom session user identifier
    • send

      void send()
      Send all outgoing messages (unique and summed) currently queued
    • addUniqueEvent

      boolean addUniqueEvent(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(String name, Map<String,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 event
      attributes - linked attributes which will update this unique event on update
      Returns:
      true if added successfully, otherwise false.
    • getUniqueEvents

      Get the pending list of unique events
      Returns:
      list of pending unique events to send
    • addSummedEvent

      boolean addSummedEvent(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:
    • addSummedEvent

      boolean addSummedEvent(String metricGroupName, Map<String,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.io
      attributes - 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

      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