Skip to content

Commit

Permalink
IWF-512: Add end timestamp to events
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolczynski committed Feb 6, 2025
1 parent 2175081 commit 2d93ad0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service/interpreter/activityImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func StateApiWaitUntil(
StateId: ptr.Any(input.Request.WorkflowStateId),
StateExecutionId: ptr.Any(input.Request.Context.GetStateExecutionId()),
StartTimestampInMs: ptr.Any(stateApiWaitUntilStartTime),
EndTimestampInMs: ptr.Any(time.Now().UnixMilli()),
SearchAttributes: searchAttributes,
})
return nil, composeHttpError(
Expand All @@ -80,6 +81,7 @@ func StateApiWaitUntil(
StateId: ptr.Any(input.Request.WorkflowStateId),
StateExecutionId: ptr.Any(input.Request.Context.GetStateExecutionId()),
StartTimestampInMs: ptr.Any(stateApiWaitUntilStartTime),
EndTimestampInMs: ptr.Any(time.Now().UnixMilli()),
SearchAttributes: searchAttributes,
})
return nil, composeStartApiRespError(provider, err, resp)
Expand Down Expand Up @@ -156,6 +158,7 @@ func StateApiExecute(
StateId: ptr.Any(input.Request.WorkflowStateId),
StateExecutionId: input.Request.Context.StateExecutionId,
StartTimestampInMs: ptr.Any(stateApiExecuteStartTime),
EndTimestampInMs: ptr.Any(time.Now().UnixMilli()),
SearchAttributes: searchAttributes,
})
return nil, composeHttpError(
Expand All @@ -172,6 +175,7 @@ func StateApiExecute(
StateId: ptr.Any(input.Request.WorkflowStateId),
StateExecutionId: input.Request.Context.StateExecutionId,
StartTimestampInMs: ptr.Any(stateApiExecuteStartTime),
EndTimestampInMs: ptr.Any(time.Now().UnixMilli()),
SearchAttributes: searchAttributes,
})
return nil, composeExecuteApiRespError(provider, err, resp)
Expand Down
3 changes: 3 additions & 0 deletions service/interpreter/workflowImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func InterpreterImpl(
WorkflowRunId: provider.GetWorkflowInfo(ctx).WorkflowExecution.RunID,
SearchAttributes: sas,
StartTimestampInMs: ptr.Any(provider.GetWorkflowInfo(ctx).WorkflowStartTime.UnixMilli()),
EndTimestampInMs: ptr.Any(provider.Now(ctx).UnixMilli()),
})
}
}
Expand Down Expand Up @@ -646,6 +647,7 @@ func processStateExecution(
StateId: ptr.Any(state.StateId),
StateExecutionId: ptr.Any(stateExeId),
StartTimestampInMs: ptr.Any(stateWaitUntilApiStartTime),
EndTimestampInMs: ptr.Any(provider.Now(ctx).UnixMilli()),
SearchAttributes: persistenceManager.GetAllSearchAttributes(),
})
}
Expand Down Expand Up @@ -924,6 +926,7 @@ func invokeStateExecute(
WorkflowRunId: provider.GetWorkflowInfo(ctx).WorkflowExecution.RunID,
StateId: ptr.Any(state.StateId),
StartTimestampInMs: ptr.Any(stateExecuteApiStartTime),
EndTimestampInMs: ptr.Any(provider.Now(ctx).UnixMilli()),
StateExecutionId: ptr.Any(stateExeId),
SearchAttributes: persistenceManager.GetAllSearchAttributes(),
})
Expand Down

0 comments on commit 2d93ad0

Please sign in to comment.