mirror of
https://github.com/clearml/clearml-server
synced 2025-03-03 10:43:10 +00:00
Use task active duration for worker task running time
This commit is contained in:
parent
a25cd5dae8
commit
afdc56f37c
@ -258,7 +258,7 @@ class WorkerBLL:
|
|||||||
tasks_info = {
|
tasks_info = {
|
||||||
task.id: task
|
task.id: task
|
||||||
for task in Task.objects(id__in=task_ids).only(
|
for task in Task.objects(id__in=task_ids).only(
|
||||||
"name", "started", "last_iteration"
|
"name", "started", "last_iteration", "active_duration"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,11 +283,7 @@ class WorkerBLL:
|
|||||||
if helper.task_id:
|
if helper.task_id:
|
||||||
task = tasks_info.get(helper.task_id, None)
|
task = tasks_info.get(helper.task_id, None)
|
||||||
if task:
|
if task:
|
||||||
worker.task.running_time = (
|
worker.task.running_time = (task.active_duration or 0) * 1000
|
||||||
int((datetime.utcnow() - task.started).total_seconds() * 1000)
|
|
||||||
if task.started
|
|
||||||
else 0
|
|
||||||
)
|
|
||||||
worker.task.last_iteration = task.last_iteration
|
worker.task.last_iteration = task.last_iteration
|
||||||
|
|
||||||
update_queue_entries(worker.queue)
|
update_queue_entries(worker.queue)
|
||||||
|
Loading…
Reference in New Issue
Block a user