Zum Hauptinhalt springen

IPipelineExecutionReporter

Namespace: Meshmakers.Octo.Sdk.Common.Services

Interface for reporting pipeline execution metrics to the communication controller. Implementations should handle the communication with the backend service.

public interface IPipelineExecutionReporter

Methods​

ReportExecutionStartAsync(RtEntityId, Guid, PipelineTriggerType, DateTime, String)​

Reports the start of a pipeline execution.

Task ReportExecutionStartAsync(RtEntityId pipelineRtEntityId, Guid executionId, PipelineTriggerType triggerType, DateTime startedAt, string inputData)

Parameters​

pipelineRtEntityId RtEntityId
The pipeline entity ID

executionId Guid
Unique execution identifier

triggerType PipelineTriggerType
Type of trigger that started the execution

startedAt DateTime
When the execution started (UTC)

inputData String
Optional input data for debugging

Returns​

Task
Task representing the async operation

ReportExecutionEndAsync(Guid, PipelineExecutionStatus, DateTime, Int32, String, String)​

Reports the end of a pipeline execution.

Task ReportExecutionEndAsync(Guid executionId, PipelineExecutionStatus status, DateTime completedAt, int durationMs, string errorMessage, string outputData)

Parameters​

executionId Guid
Unique execution identifier

status PipelineExecutionStatus
Final status of the execution

completedAt DateTime
When the execution completed (UTC)

durationMs Int32
Duration in milliseconds

errorMessage String
Optional error message if failed

outputData String
Optional output data (JSON) from pipeline result

Returns​

Task
Task representing the async operation

ReportExecutionEndAsync(Guid, PipelineExecutionStatus, DateTime, Int32, String, String, Nullable<PipelineExecutionFailureKind>)​

Reports the end of a pipeline execution together with the failure kind of a failed execution.

Task ReportExecutionEndAsync(Guid executionId, PipelineExecutionStatus status, DateTime completedAt, int durationMs, string errorMessage, string outputData, Nullable<PipelineExecutionFailureKind> failureKind)

Parameters​

executionId Guid
Unique execution identifier

status PipelineExecutionStatus
Final status of the execution

completedAt DateTime
When the execution completed (UTC)

durationMs Int32
Duration in milliseconds

errorMessage String
Error message if failed

outputData String
Output data (JSON) from pipeline result

failureKind Nullable<PipelineExecutionFailureKind>
What a failed execution says about its writes, derived with from the exception that ended it; null when the status is not . Never a marker in errorMessage.

Returns​

Task
Task representing the async operation

Remarks:

A separate member, so implementers and callers of the six-parameter member keep compiling and binding. The default implementation forwards to the six-parameter member and therefore drops failureKind: an implementer that wants the controller to answer a pipeline method METHOD_OUTCOME_UNKNOWN overrides this member (as AdapterPipelineExecutionReporter does).

ReportPipelineStatusAsync(RtEntityId, String, Boolean, DateTime)​

Reports a pipeline's live status line — one line per poll from a trigger node, written by the controller to the pipeline entity's StatusMessage.

Task ReportPipelineStatusAsync(RtEntityId pipelineRtEntityId, string message, bool isError, DateTime timestampUtc)

Parameters​

pipelineRtEntityId RtEntityId
The pipeline entity ID

message String
The status line

isError Boolean
True when the line reports a failed poll

timestampUtc DateTime
When the status was produced (UTC)

Returns​

Task
Task representing the async operation

Remarks:

Never throws and must not block the caller on the controller: delivery is fire-and-forget, and a delivery failure (hub not connected, a controller predating the hub method) is logged at Debug, rate-limited so a poll loop does not repeat it every interval.

GetInterruptedExecutionIdsAsync()​

Gets the list of execution IDs that were marked as interrupted when this adapter disconnected. Called after reconnection to determine which executions need their final status reported.

Task<IReadOnlyList<string>> GetInterruptedExecutionIdsAsync()

Returns​

Task<IReadOnlyList<String>>
List of interrupted execution IDs

FailOrphanedExecutionsAsync(DateTime)​

Asks the controller to fail all non-terminal executions of this adapter that started before the given process start time. Called once on a fresh adapter startup to resolve executions orphaned by the previous process (whose in-memory task was lost on restart), so they are not left stuck in Running/Interrupted.

Task<int> FailOrphanedExecutionsAsync(DateTime processStartUtc)

Parameters​

processStartUtc DateTime
The adapter process start time (UTC)

Returns​

Task<Int32>
Number of orphaned executions failed, or 0 if reporting failed

ReportInterruptedExecutionResultAsync(Guid, PipelineExecutionStatus, DateTime, Int32, String, String)​

Reports the final result of an execution that was previously marked as interrupted.

Task ReportInterruptedExecutionResultAsync(Guid executionId, PipelineExecutionStatus status, DateTime completedAt, int durationMs, string errorMessage, string outputData)

Parameters​

executionId Guid
Unique execution identifier

status PipelineExecutionStatus
Final status of the execution

completedAt DateTime
When the execution completed (UTC)

durationMs Int32
Duration in milliseconds

errorMessage String
Optional error message if failed

outputData String
Optional output data (JSON) from pipeline result

Returns​

Task
Task representing the async operation