Bird
0
0

What will be the output of this Prometheus query if the metric 'cpu_usage_seconds_total' has values 10 at time T-5m and 20 at time T?

medium📝 Command Output Q5 of 15
Kubernetes - Monitoring and Logging
What will be the output of this Prometheus query if the metric 'cpu_usage_seconds_total' has values 10 at time T-5m and 20 at time T?
rate(cpu_usage_seconds_total[5m])
A10 (total CPU usage seconds)
B5 (difference between values)
C20 (current CPU usage seconds)
D0.0333 (10 seconds per 300 seconds)
Step-by-Step Solution
Solution:
  1. Step 1: Calculate rate() as per-second increase

    Difference = 20 - 10 = 10 seconds over 5 minutes (300 seconds).
  2. Step 2: Compute per-second rate

    Rate = 10 / 300 = 0.0333 seconds per second.
  3. Final Answer:

    0.0333 (10 seconds per 300 seconds) -> Option D
  4. Quick Check:

    rate() = difference / time window [OK]
Quick Trick: rate() = (value difference) / (time in seconds) [OK]
Common Mistakes:
  • Using total or current values instead of rate
  • Ignoring time window length
  • Confusing difference with rate

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes