sumerc / yappi

Yet Another Python Profiler, but this time multithreading, asyncio and gevent aware.
MIT License
1.45k stars 73 forks source link

The new tag and ctx_id parameters of get_func_stats() are ignored #56

Closed sm-Fifteen closed 4 years ago

sm-Fifteen commented 4 years ago

The latest release of yappi has begun to phase out get_func_stats(filter={}) in favor of tag, ctx_id and filter_callback. However, I ended up noticing while using tag to profile coroutines, it seems that tag and ctx_id are currently being ignored.

https://github.com/sumerc/yappi/blob/b0e424fb269ffa9fe91690343a09f65016f42ab1/yappi/yappi.py#L1094-L1104

(Notice how both variables aren't passed or stored anywhere)

It can currently be worked around by writing this:

yappi.get_func_stats(
    filter=dict(tag=ctx_tag),
    #...
)

rather than this

yappi.get_func_stats(tag=ctx_tag)
sumerc commented 4 years ago

Yes. I also happen to see this a few days ago.

So much focusing on backward compatibility makes me lose sight :)

It will be fixed in https://github.com/sumerc/yappi/pull/55 with more tests on this usage pattern along with some other minor issues as well and I will be releasing a new hotfix version in few days hopefully.

sumerc commented 4 years ago

Fixed in #55

sumerc commented 4 years ago

Released a new hotfix version with this fix.

sm-Fifteen commented 4 years ago

Excellent, thank you @sumerc!