8000 tracer pass runtime to task_success signal · Issue #6478 · celery/celery · GitHub
[go: up one dir, main page]

Skip to content
tracer pass runtime to task_success signal #6478
@hot123s

Description

@hot123s

Checklist

  • I have checked the issues list
    for similar or identical feature requests.
  • I have checked the pull requests list
    for existing proposed implementations of this feature.
  • I have checked the commit log
    to find out if the if the same feature was already implemented in the
    master branch.
  • I have included all related issues and possible duplicate issues
    in this issue (If there are none, check this box anyway).

Proposed Behavior

I think it would be better to pass task runtime to task_success signal receiver

this is old code,only pass task object and result

celery/celery/app/trace.py

Lines 480 to 487 in 28ebcce

I, R, state, retval = on_error(task_request, exc, uuid)
else:
Rstr = saferepr(R, resultrepr_maxsize)
T = monotonic() - time_start
if task_on_success:
task_on_success(retval, uuid, args, kwargs)
if success_receivers:
send_success(sender=task, result=retval)

and I think passing runtime will be better

T = monotonic() - time_start 
if success_receivers: 
         send_success(sender=task, runtime=T, result=retval) 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0