
Answer-first summary for fast verification
Answer: Modify your Go application to capture profiling data. Analyze the CPU metrics of your application in flame graphs in Profiler.
To identify which Go functions consume the most CPU, modifying the application to capture profiling data and using Google Cloud Profiler with flame graphs (Option D) is the correct approach. Cloud Profiler provides detailed function-level CPU usage insights, enabling optimization. Other options are insufficient: Fluent Bit (A) focuses on logging, not profiling; Cloud Monitoring (B) offers high-level metrics but not code-level details; the `top` command (C) shows process-level CPU usage, not function-level breakdown.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To identify the Go functions consuming the most CPU in your GKE-deployed application for optimization, what steps should you take?
(Optional code block if applicable, corrected for syntax/typos):
// Example placeholder for potential code needing correction
func highCPUFunction() {
for {
// CPU-intensive operations
}
}
// Example placeholder for potential code needing correction
func highCPUFunction() {
for {
// CPU-intensive operations
}
}
A
Deploy a Fluent Bit daemonset on the GKE cluster to log data in Cloud Logging. Analyze the logs to get insights into your application code’s performance.
B
Create a custom dashboard in Cloud Monitoring to evaluate the CPU performance metrics of your application.
C
Connect to your GKE nodes using SSH. Run the top command on the shell to extract the CPU utilization of your application.
D
Modify your Go application to capture profiling data. Analyze the CPU metrics of your application in flame graphs in Profiler.
No comments yet.