Class: Fractor::Workflow::WorkflowResult
- Inherits:
-
Object
- Object
- Fractor::Workflow::WorkflowResult
- Defined in:
- lib/fractor/workflow/workflow_result.rb
Overview
Represents the result of a workflow execution. Contains information about completed jobs, failed jobs, execution time, and output.
Instance Attribute Summary collapse
-
#completed_jobs ⇒ Object
readonly
Returns the value of attribute completed_jobs.
-
#correlation_id ⇒ Object
readonly
Returns the value of attribute correlation_id.
-
#execution_time ⇒ Object
readonly
Returns the value of attribute execution_time.
-
#failed_jobs ⇒ Object
readonly
Returns the value of attribute failed_jobs.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
-
#workflow_name ⇒ Object
readonly
Returns the value of attribute workflow_name.
Instance Method Summary collapse
-
#execution_time_ms ⇒ Float
Get execution time in milliseconds.
-
#failed? ⇒ Boolean
Check if the workflow failed.
-
#initialize(workflow_name:, output:, completed_jobs:, failed_jobs:, execution_time:, success:, trace: nil, correlation_id: nil) ⇒ WorkflowResult
constructor
Initialize a new workflow result.
-
#success? ⇒ Boolean
Check if the workflow succeeded.
Constructor Details
#initialize(workflow_name:, output:, completed_jobs:, failed_jobs:, execution_time:, success:, trace: nil, correlation_id: nil) ⇒ WorkflowResult
Initialize a new workflow result.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fractor/workflow/workflow_result.rb', line 21 def initialize(workflow_name:, output:, completed_jobs:, failed_jobs:, execution_time:, success:, trace: nil, correlation_id: nil) @workflow_name = workflow_name @output = output @completed_jobs = completed_jobs @failed_jobs = failed_jobs @execution_time = execution_time @success = success @trace = trace @correlation_id = correlation_id end |
Instance Attribute Details
#completed_jobs ⇒ Object (readonly)
Returns the value of attribute completed_jobs.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def completed_jobs @completed_jobs end |
#correlation_id ⇒ Object (readonly)
Returns the value of attribute correlation_id.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def correlation_id @correlation_id end |
#execution_time ⇒ Object (readonly)
Returns the value of attribute execution_time.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def execution_time @execution_time end |
#failed_jobs ⇒ Object (readonly)
Returns the value of attribute failed_jobs.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def failed_jobs @failed_jobs end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def output @output end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def success @success end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def trace @trace end |
#workflow_name ⇒ Object (readonly)
Returns the value of attribute workflow_name.
8 9 10 |
# File 'lib/fractor/workflow/workflow_result.rb', line 8 def workflow_name @workflow_name end |
Instance Method Details
#execution_time_ms ⇒ Float
Get execution time in milliseconds.
50 51 52 |
# File 'lib/fractor/workflow/workflow_result.rb', line 50 def execution_time_ms (@execution_time * 1000).round(2) end |
#failed? ⇒ Boolean
Check if the workflow failed.
43 44 45 |
# File 'lib/fractor/workflow/workflow_result.rb', line 43 def failed? !@success end |
#success? ⇒ Boolean
Check if the workflow succeeded.
36 37 38 |
# File 'lib/fractor/workflow/workflow_result.rb', line 36 def success? @success end |