
Answer-first summary for fast verification
Answer: Import the Cloud Profiler package into your application, and initialize the Profiler agent. Review the generated flame graph in the Google Cloud console to identify time-intensive functions.
To determine which function is consuming the most CPU and memory resources in a GKE-deployed Go application, the most effective approach is to use Cloud Profiler. Cloud Profiler is designed for continuous analysis of resource utilization (CPU, memory) and generates flame graphs to pinpoint performance bottlenecks. Option D correctly implements this by integrating the Profiler agent and analyzing the flame graph. Other options are less suitable: Option A involves manual logging, which is inefficient. Option B relies on log timestamps, which may not directly correlate to resource usage. Option C focuses on latency via Trace, which relates to request timing but not directly to CPU/memory consumption.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To identify the function consuming the most CPU and memory resources in a Go web application deployed on Google Kubernetes Engine, what steps should you take?
A
Add print commands to the application source code to log when each function is called, and redeploy the application.
B
Create a Cloud Logging query that gathers the web application s logs. Write a Python script that calculates the difference between the timestamps from the beginning and the end of the application's longest functions to identify time-intensive functions.
C
Import OpenTelemetry and Trace export packages into your application, and create the trace provider. Review the latency data for your application on the Trace overview page, and identify which functions cause the most latency.
D
Import the Cloud Profiler package into your application, and initialize the Profiler agent. Review the generated flame graph in the Google Cloud console to identify time-intensive functions.
No comments yet.