Pipeline.Monitoring.Performance (pipeline v0.0.1)

View Source

Performance monitoring and metrics collection for pipeline execution.

Provides real-time performance tracking, memory usage monitoring, bottleneck identification, and performance optimization recommendations.

Summary

Functions

Check if performance thresholds are being exceeded.

Returns a specification to start this module under a supervisor.

Get current performance metrics.

Start performance monitoring for a pipeline.

Record step completion event.

Stop performance monitoring and return final metrics.

Types

metric_value()

@type metric_value() :: number()

metrics()

@type metrics() :: %{
  memory_usage: metric_value(),
  cpu_usage: metric_value(),
  execution_time: metric_value(),
  step_count: non_neg_integer(),
  error_count: non_neg_integer()
}

t()

@type t() :: %Pipeline.Monitoring.Performance{
  execution_threshold: term(),
  memory_threshold: term(),
  metrics: term(),
  pipeline_name: term(),
  samples: term(),
  start_time: term(),
  step_metrics: term(),
  warnings: term()
}

Functions

check_thresholds(pipeline_name)

@spec check_thresholds(String.t()) :: {:ok, list()} | {:error, term()}

Check if performance thresholds are being exceeded.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_metrics(pipeline_name)

@spec get_metrics(String.t()) :: {:ok, map()} | {:error, term()}

Get current performance metrics.

start_monitoring(pipeline_name, opts \\ [])

@spec start_monitoring(
  String.t(),
  keyword()
) :: {:ok, pid()} | {:error, term()}

Start performance monitoring for a pipeline.

step_completed(pipeline_name, step_name, result)

@spec step_completed(String.t(), String.t(), map()) :: :ok

Record step completion event.

step_failed(pipeline_name, step_name, error)

@spec step_failed(String.t(), String.t(), String.t()) :: :ok

Record step failure event.

step_started(pipeline_name, step_name, step_type)

@spec step_started(String.t(), String.t(), String.t()) :: :ok

Record step start event.

stop_monitoring(pipeline_name)

@spec stop_monitoring(String.t()) :: {:ok, map()} | {:error, term()}

Stop performance monitoring and return final metrics.