Class ActionStats
- java.lang.Object
-
- org.pipecraft.infra.monitoring.collectors.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 Summary
Constructors Constructor Description ActionStats(long completedCount, long totalDurationMicros)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetAvgActionDuration()Map<String,? extends JsonMonitorable>getChildren()longgetCompletedCount()net.minidev.json.JSONObjectgetOwnMetrics()longgetTotalDurationMicros()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.pipecraft.infra.monitoring.JsonMonitorable
getFullMetrics
-
-
-
-
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:
getOwnMetricsin interfaceJsonMonitorable- Returns:
- The json string describing the entity, not including the child entities.
-
getChildren
public Map<String,? extends JsonMonitorable> getChildren()
- Specified by:
getChildrenin interfaceJsonMonitorable- 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.
-
-