Class PipelineMetrics
java.lang.Object
com.tnsai.coordination.groups.pipeline.PipelineMetrics
Tracks per-stage timing, throughput, and bottleneck metrics for a pipeline.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAverageDuration(String stageName) Gets the average duration for a stage.Identifies the bottleneck stage (highest average duration).intgetExecutionCount(String stageName) Gets the total executions for a stage.intgetFailureCount(String stageName) Gets the failure count for a stage.Returns metrics summary for all stages.voidrecordStageExecution(String stageName, long durationMs, boolean success) Records the execution of a stage.
-
Constructor Details
-
PipelineMetrics
public PipelineMetrics()
-
-
Method Details
-
recordStageExecution
Records the execution of a stage.- Parameters:
stageName- stage namedurationMs- execution duration in millisecondssuccess- whether the stage succeeded
-
getAverageDuration
Gets the average duration for a stage.- Parameters:
stageName- stage name- Returns:
- average duration, or empty if no data
-
getExecutionCount
Gets the total executions for a stage.- Parameters:
stageName- stage name- Returns:
- execution count
-
getFailureCount
Gets the failure count for a stage.- Parameters:
stageName- stage name- Returns:
- failure count
-
getBottleneck
Identifies the bottleneck stage (highest average duration).- Returns:
- bottleneck stage name, or empty if no data
-
getSummary
Returns metrics summary for all stages.- Returns:
- map of stage name to summary string
-