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
feat: add pyinstrument integration to Flask API endpoints #722
Conversation
Signed-off-by: Nischay Ram Mamidi <NischayPro@gmail.com>
486c87a
to
6311f80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far, and a good start (we might change how we store reports later, but we first should get started using it).
I have a few comments to make it safer to use.
Also, please add a changelog entry.
Signed-off-by: Nischay Ram Mamidi <NischayPro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
A small batch of docs improvements.
Can you hit "Resolve conversation" on all comments you've implemented?
If you disagree or didn't do it, then leave them open. Then I as a reviewer can easily see what's left.
Signed-off-by: Nischay Ram Mamidi <NischayPro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Please add an entry in documentation/changelog.rst for this infrastructure feature :)
Signed-off-by: Nischay Ram Mamidi <NischayPro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thanks!
This PR provides profiling integration to developers for API endpoints, partially implementing the first half of #721.
To enable the profiler you need to export the
FLEXMEASURES_PROFILE_REQUESTS
environment variable with a value ofTrue
. Alternatively you can update theflexmeasures.cfg
file reflecting the same.The remaining steps are same as launching
flexmeasures
from the CLI.Any profile reports generated would be saved in the
profile_reports
directory of the instance grouped into the date when the endpoint was profiled.The file naming format for profile reports is
pyinstrument_{ENDPOINT_NAME}