Skip to content

Commit 2a4bd33

Browse files
committed
merge in develop
Signed-off-by: Neil South <[email protected]>
1 parent 5d6ce19 commit 2a4bd33

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,15 @@ private Dictionary<string, string> GetExecutuionStats(Workflow workflow)
215215
{
216216
Guard.Against.Null(workflow);
217217

218+
TimeSpan? duration = null;
219+
if (workflow.Status?.StartedAt is not null && workflow.Status?.FinishedAt is not null)
220+
{
221+
duration = workflow.Status?.FinishedAt - workflow.Status?.StartedAt;
222+
}
218223
var stats = new Dictionary<string, string>
219224
{
220225
{ "workflowId", Event.WorkflowInstanceId },
221-
{ "duration", workflow.Status?.EstimatedDuration.ToString() ?? string.Empty },
226+
{ "duration", duration.HasValue ? duration.Value.TotalMilliseconds.ToString() : string.Empty },
222227
{ "startedAt", workflow.Status?.StartedAt.ToString() ?? string.Empty },
223228
{ "finishedAt", workflow.Status?.FinishedAt.ToString() ?? string.Empty }
224229
};

0 commit comments

Comments
 (0)