
Answer-first summary for fast verification
Answer: Instrument the service with Cloud Profiler to measure CPU utilization and method-level execution times in the service.
The question asks to measure both performance (method-level execution times) and system resource utilization (CPU) in a Java microservice. Cloud Profiler (A) is specifically designed for continuous profiling, providing CPU utilization data and detailed method-level performance metrics, directly addressing both requirements. While Cloud Trace (C) focuses on request latency and OpenCensus (D) can collect custom metrics, Cloud Profiler offers a more integrated and automatic solution without requiring custom code. Debugger (B) is for debugging errors, not performance measurement, making A the correct choice.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you measure performance and system resource utilization in a Java-based microservice within a distributed architecture?
A
Instrument the service with Cloud Profiler to measure CPU utilization and method-level execution times in the service.
B
Instrument the service with Debugger to investigate service errors.
C
Instrument the service with Cloud Trace to measure request latency.
D
Instrument the service with OpenCensus to measure service latency, and write custom metrics to Cloud Monitoring.
No comments yet.