Interface ActionStatsCollector<E extends Enum<E>>

    • Method Detail

      • start

        void start()
        Indicates that an action has started. Must be followed by end(category).
      • duration

        long duration()
        Returns:
        The current duration (in microseconds) of the started action. Returns an undefined value if no action has been started yet.
      • end

        long end​(E category)
        Indicates that an action has terminated.
        Parameters:
        category - The category to place the action stats into
        Returns:
        The duration, in microseconds, of the action
      • startAndEnd

        void startAndEnd​(E category)
        Indicates the starting and termination of an "instant" action (duration = 0)
        Parameters:
        category - The category to place the action stats into
      • getRunning

        int getRunning()
        Returns:
        The number of actions currently in execution
      • getCompletedCount

        long getCompletedCount​(E category)
        Parameters:
        category - A stats category
        Returns:
        The number of actions of the given category that has been completed so far
      • getTotalDurationMicros

        long getTotalDurationMicros​(E category)
        Parameters:
        category - A stats category
        Returns:
        The total duration of completed actions in the given category
      • getAll

        ActionStatsMap<E> getAll()
        Returns:
        A snapshot of all statistics. The data consistency guarantees depend on the specific implementation.
      • clear

        void clear()
        Clears all statistics. The atomicity of this operation depends on the specific implementation.