-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add Profiler code samples for App Engine #2028
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
Conversation
profiler/appengine/flexible/main.py
Outdated
# on GCP. | ||
googlecloudprofiler.start(verbose=3) | ||
except (ValueError, NotImplementedError) as exc: | ||
print(exc) # Handles errors here |
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.
nit: handle not handles
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.
Done.
# on GCP. | ||
googlecloudprofiler.start(verbose=3) | ||
except (ValueError, NotImplementedError) as exc: | ||
print(exc) # Handles errors here |
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.
nit: handle not handles
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.
Done.
entrypoint: gunicorn -b :$PORT main:app | ||
|
||
runtime_config: | ||
python_version: 3 |
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.
It would be helpful to add a comment here that using python_version 3, Python 3.7.x is used which supports both Wall & CPU profiling.
https://cloud.google.com/appengine/docs/flexible/python/runtime
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.
Done.
@jqll do these simple apps generate any interesting profiles? Would it help to add a specific duration of CPU workload? |
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.
This is a bit of a rubberstamp approval - the code makes sense but it's important to test the samples to make sure they actually work, I might easily miss something.
The server keeps checking if there are requests, so we get some interesting profiles even if nobody sends requests. See the screenshot. |
Tested that both samples can be deployed and we get profiles as expected. |
thanks for the clarification. LGTM. |
No description provided.