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

Feature request: Incremental stats clearing #42

Open
sm-Fifteen opened this issue Jan 8, 2020 · 1 comment
Open

Feature request: Incremental stats clearing #42

sm-Fifteen opened this issue Jan 8, 2020 · 1 comment
Assignees

Comments

@sm-Fifteen
Copy link

Yappi is currently poorly suited to long-running applications, since the only way to free a set of profiling stats once they're no longer needed is to clear the all of the profiler's memory, effectively resetting it. In a multi-threaded or async system, this is almost certain to interfere with the other threads, and even if losing profiler data isn't critical, it could lead to some frustration when attempting to isolate some of the longer code paths applications that are meant to run for extended periods of time (such as any kind of server).

There should be an alternative to clear_stats() that allows the user to pass the same kind of filter passed to get_func_stats() to cleanup select parts of the profiler stats. Alternatively, this could be implementad as a method to YFuncStat, which would free all memory related to the function calls contained within.

@sumerc sumerc self-assigned this Jan 8, 2020
@sumerc sumerc added the 1.3 label Jan 8, 2020
@sumerc
Copy link
Owner

sumerc commented Jan 8, 2020

Thanks for the explanation.

We have also discussed this before on fastapi/fastapi#701 and clear_stats() filtering might be worth implementing for using in long running servers/middleware as you proposed.

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