Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation PCA Exam - Topic 2 Question 17 Discussion

How do you calculate the average request duration during the last 5 minutes from a histogram or summary called http_request_duration_seconds?
A) rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_count[5m])
B) rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_second$_count[5m])
C) rate(http_request_duration_seconds_total[5m]) / rate(http_request_duration_seconds_average[5m])
D) rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_average[5m])

Linux Foundation PCA Exam - Topic 2 Question 17 Discussion

Actual exam question for Linux Foundation's PCA exam
Question #: 17
Topic #: 2
[All PCA Questions]

How do you calculate the average request duration during the last 5 minutes from a histogram or summary called http_request_duration_seconds?

Show Suggested Answer Hide Answer
Suggested Answer: A

In Prometheus, histograms and summaries expose metrics with _sum and _count suffixes to represent total accumulated values and sample counts, respectively. To compute the average request duration over a given time window (for example, 5 minutes), you divide the rate of increase of _sum by the rate of increase of _count:

text{Average duration} = frac{text{rate(http_request_duration_seconds_sum[5m])}}{text{rate(http_request_duration_seconds_count[5m])}}

Here,

http_request_duration_seconds_sum represents the total accumulated request time, and

http_request_duration_seconds_count represents the number of requests observed.

By dividing these rates, you obtain the average request duration per request over the specified time range.


Extracted and verified from Prometheus documentation -- Querying Histograms and Summaries, PromQL Rate Function, and Metric Naming Conventions sections.

Contribute your Thoughts:

0/2000 characters
Lizette
1 day ago
I’m leaning towards A too. It’s clear and logical.
upvoted 0 times
...
Michal
6 days ago
Option B looks tempting, but I feel the naming is off.
upvoted 0 times
...
Christoper
11 days ago
I agree, A seems straightforward. Average needs both.
upvoted 0 times
...
Micaela
17 days ago
I think option A is correct. It makes sense to use sum and count.
upvoted 0 times
...
Leonardo
22 days ago
D) sounds off to me, not sure about that one.
upvoted 0 times
...
Crissy
27 days ago
Wait, is C) even a valid option?
upvoted 0 times
...
Whitney
1 month ago
I think B) makes more sense, though.
upvoted 0 times
...
Alease
1 month ago
A) is the right choice!
upvoted 0 times
...
Trina
1 month ago
How can you trust those rates over just raw counts?
upvoted 0 times
...
Lauran
2 months ago
Totally agree with A), it makes the most sense.
upvoted 0 times
...
Jaclyn
2 months ago
Wait, is there even an average metric in the options?
upvoted 0 times
...
In
2 months ago
I think B) is a better choice.
upvoted 0 times
...
Clare
2 months ago
A) is the correct formula!
upvoted 0 times
...
Skye
2 months ago
I thought the average was derived from sum and count, so A makes sense, but I wonder if there's a catch with the time window.
upvoted 0 times
...
Salina
2 months ago
I'm a bit confused about option B; it mentions total and count, but I don't recall if that's the standard way to calculate averages.
upvoted 0 times
...
Shawna
3 months ago
I remember practicing a similar question, and I feel like the average request duration is calculated using the sum and count, so A seems right to me.
upvoted 0 times
...
Trina
3 months ago
I think the answer might be A, but I'm not entirely sure about the difference between sum and total in this context.
upvoted 0 times
...

Save Cancel