Pipeline.Debug.NestedExecution (pipeline v0.0.1)

View Source

Debugging tools and utilities for nested pipeline execution.

Provides interactive debugging capabilities, execution analysis, and troubleshooting tools for complex nested pipeline workflows.

Summary

Functions

Analyze execution for performance issues and optimization opportunities.

Compare execution performance between different traces.

Print comprehensive execution tree with debugging information.

Generate a debugging report for troubleshooting.

Show context information at a specific point in execution.

Search for specific patterns in execution traces.

Start an interactive debugging session for a trace context.

Types

analysis_result()

@type analysis_result() :: %{
  performance_issues: [map()],
  potential_optimizations: [String.t()],
  error_patterns: [map()],
  resource_usage: map(),
  recommendations: [String.t()]
}

debug_session()

@type debug_session() :: %{
  trace_context: map(),
  execution_tree: map(),
  debug_options: map(),
  session_id: String.t(),
  start_time: DateTime.t(),
  commands_history: [String.t()]
}

trace_context()

Functions

analyze_execution(execution_tree, options \\ %{})

@spec analyze_execution(map(), map()) :: analysis_result()

Analyze execution for performance issues and optimization opportunities.

Parameters

  • execution_tree: The execution tree to analyze
  • options: Analysis options

Returns

  • Analysis results with issues and recommendations

compare_executions(trace_contexts, options \\ %{})

@spec compare_executions([map()], map()) :: String.t()

Compare execution performance between different traces.

Parameters

  • trace_contexts: List of trace contexts to compare
  • options: Comparison options

Returns

  • Formatted comparison report

debug_execution_tree(context, options \\ %{})

@spec debug_execution_tree(map(), map()) :: String.t()

Print comprehensive execution tree with debugging information.

Parameters

  • context: Execution context or debug session
  • options: Display options

Returns

  • Formatted debug output

generate_debug_report(trace_context)

@spec generate_debug_report(trace_context()) :: String.t()

Generate a debugging report for troubleshooting.

Parameters

  • trace_context: The trace context to analyze
  • error: Optional error that occurred
  • options: Report generation options

Returns

  • Comprehensive debugging report

generate_debug_report(trace_context, error)

@spec generate_debug_report(trace_context(), any()) :: String.t()

generate_debug_report(trace_context, error, options)

@spec generate_debug_report(trace_context(), any(), map()) :: String.t()

inspect_context(context)

@spec inspect_context(map()) :: String.t()

Show context information at a specific point in execution.

Parameters

  • context: Execution context to inspect
  • step: Optional step information

Returns

  • Formatted context information

inspect_context(context, step)

@spec inspect_context(map(), map() | nil) :: String.t()

search_execution(trace_context, pattern, search_in \\ :all)

@spec search_execution(map(), String.t() | Regex.t(), atom()) :: [map()]

Search for specific patterns in execution traces.

Parameters

  • trace_context: Trace context to search
  • pattern: Search pattern (string or regex)
  • search_in: What to search in (:pipeline_ids, :step_names, :errors, :all)

Returns

  • List of matching spans with context

start_debug_session(trace_context)

@spec start_debug_session(trace_context()) :: debug_session()

Start an interactive debugging session for a trace context.

Parameters

  • trace_context: The trace context to debug
  • options: Debug session options

Returns

  • Debug session context

start_debug_session(trace_context, options)

@spec start_debug_session(trace_context(), map()) :: debug_session()