Interface Metrics

    • Method Detail

      • enable

        void enable​(BacktraceMetricsSettings settings)
        Enable metrics
        Parameters:
        settings - for Backtrace metrics
      • 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 event
        attributes - 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.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:
        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