
Answer-first summary for fast verification
Answer: Enable the Cloud Profiler API and add google-cloud-profiler to your requirements.txt file
The correct approach involves enabling the Cloud Profiler API and including `google-cloud-profiler` in your `requirements.txt` file. This setup allows for continuous monitoring of CPU and memory usage. Cloud Profiler is specifically designed for this purpose, unlike Cloud Trace, which is not suitable for continuous CPU and memory monitoring. Additionally, since App Engine Standard Environment restricts access to the underlying instance, direct installation or management of packages isn't feasible, making the Cloud Profiler API the optimal solution. For more details, refer to the Cloud Profiler overview and guidelines for profiling Python applications.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your company is deploying a Python application on Google App Engine Standard Environment and needs to continuously monitor CPU usage in production. Which steps should you take to achieve this?
A
Enable the Cloud Trace API
B
Install pip and Install the Trace package
C
Import google cloud profiler module and call the google cloud profiler.start function
D
Enable the Cloud Profiler API and add google-cloud-profiler to your requirements.txt file
E
Install pip and Install the Cloud Profiler package