Report queued_seconds to DD when start running (#4107)
This commit is contained in:
committed by
GitHub
parent
e006f1de29
commit
2eba38237f
@@ -1808,17 +1808,25 @@ class WorkflowService:
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def mark_workflow_run_as_running(self, workflow_run_id: str, run_with: str | None = None) -> WorkflowRun:
|
async def mark_workflow_run_as_running(self, workflow_run_id: str, run_with: str | None = None) -> WorkflowRun:
|
||||||
LOG.info(
|
workflow_run = await self._update_workflow_run_status(
|
||||||
f"Marking workflow run {workflow_run_id} as running",
|
|
||||||
workflow_run_id=workflow_run_id,
|
|
||||||
workflow_status="running",
|
|
||||||
run_with=run_with,
|
|
||||||
)
|
|
||||||
return await self._update_workflow_run_status(
|
|
||||||
workflow_run_id=workflow_run_id,
|
workflow_run_id=workflow_run_id,
|
||||||
status=WorkflowRunStatus.running,
|
status=WorkflowRunStatus.running,
|
||||||
run_with=run_with,
|
run_with=run_with,
|
||||||
)
|
)
|
||||||
|
start_time = (
|
||||||
|
workflow_run.started_at.replace(tzinfo=UTC)
|
||||||
|
if workflow_run.started_at
|
||||||
|
else workflow_run.created_at.replace(tzinfo=UTC)
|
||||||
|
)
|
||||||
|
queued_seconds = (start_time - workflow_run.created_at.replace(tzinfo=UTC)).total_seconds()
|
||||||
|
LOG.info(
|
||||||
|
f"Marked workflow run {workflow_run_id} as running",
|
||||||
|
workflow_run_id=workflow_run_id,
|
||||||
|
workflow_status="running",
|
||||||
|
run_with=run_with,
|
||||||
|
queued_seconds=queued_seconds,
|
||||||
|
)
|
||||||
|
return workflow_run
|
||||||
|
|
||||||
async def mark_workflow_run_as_terminated(
|
async def mark_workflow_run_as_terminated(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user