Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sm-Fifteen opened this issue Apr 23, 2020 · 4 comments
Closed

Comments

@sm-Fifteen
Copy link

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.

yappi/yappi/yappi.py

Lines 1094 to 1104 in b0e424f

tag = filter.get('tag', tag)
ctx_id = filter.get('ctx_id', tag)
# multiple invocation pause/resume is allowed. This is needed because
# not only get() is executed here.
_yappi._pause()
try:
stats = YFuncStats().get(filter=filter, filter_callback=filter_callback)
finally:
_yappi._resume()
return stats

(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
Copy link
Owner

sumerc commented Apr 23, 2020

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 #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
Copy link
Owner

sumerc commented Apr 27, 2020

Fixed in #55

@sumerc
Copy link
Owner

sumerc commented Apr 27, 2020

Released a new hotfix version with this fix.

@sumerc sumerc closed this as completed Apr 27, 2020
@sm-Fifteen
Copy link
Author

Excellent, thank you @sumerc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants