Class PipelineMetrics

java.lang.Object
com.tnsai.coordination.groups.pipeline.PipelineMetrics

public class PipelineMetrics extends Object
Tracks per-stage timing, throughput, and bottleneck metrics for a pipeline.
  • Constructor Details

    • PipelineMetrics

      public PipelineMetrics()
  • Method Details

    • recordStageExecution

      public void recordStageExecution(String stageName, long durationMs, boolean success)
      Records the execution of a stage.
      Parameters:
      stageName - stage name
      durationMs - execution duration in milliseconds
      success - whether the stage succeeded
    • getAverageDuration

      public Optional<Duration> getAverageDuration(String stageName)
      Gets the average duration for a stage.
      Parameters:
      stageName - stage name
      Returns:
      average duration, or empty if no data
    • getExecutionCount

      public int getExecutionCount(String stageName)
      Gets the total executions for a stage.
      Parameters:
      stageName - stage name
      Returns:
      execution count
    • getFailureCount

      public int getFailureCount(String stageName)
      Gets the failure count for a stage.
      Parameters:
      stageName - stage name
      Returns:
      failure count
    • getBottleneck

      public Optional<String> getBottleneck()
      Identifies the bottleneck stage (highest average duration).
      Returns:
      bottleneck stage name, or empty if no data
    • getSummary

      public Map<String,String> getSummary()
      Returns metrics summary for all stages.
      Returns:
      map of stage name to summary string