Class ActionStats

  • All Implemented Interfaces:
    JsonMonitorable

    public final class ActionStats
    extends Object
    implements JsonMonitorable
    Simple action statistics bean referring to a specific action type. Immutable.
    Author:
    Eyal Schneider
    • Constructor Detail

      • ActionStats

        public ActionStats​(long completedCount,
                           long totalDurationMicros)
        Constructor
        Parameters:
        completedCount - The number of completed actions
        totalDurationMicros - The total duration of completed actions, in microseconds
    • Method Detail

      • getCompletedCount

        public long getCompletedCount()
        Returns:
        The number of completed actions
      • getTotalDurationMicros

        public long getTotalDurationMicros()
        Returns:
        The total duration of completed actions, in microseconds
      • getAvgActionDuration

        public long getAvgActionDuration()
        Returns:
        The average time (in microseconds) of an action execution. -1 is returned if no action has been completed yet.
      • getOwnMetrics

        public net.minidev.json.JSONObject getOwnMetrics()
        Specified by:
        getOwnMetrics in interface JsonMonitorable
        Returns:
        The json string describing the entity, not including the child entities.
      • getChildren

        public Map<String,​? extends JsonMonitorable> getChildren()
        Specified by:
        getChildren in interface JsonMonitorable
        Returns:
        The monitorable children of this entity, as [id, JsonExportable] pairs. Using this method, the framework can manage a complete tree to be monitored, where every entity has a unique path.