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

Posted by Freeman on Jun 27, 2026 at 04:06 AM

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

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.

Get Premium PCA Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
25 comments · newest first
HU
Huey 5 days ago
C is confusing. Average isn’t needed here.
HE
Helaine 10 days ago
B looks tempting, but I feel it’s not right.
RO
Roselle 15 days ago
I agree, A makes sense. Sum over count.
VI
Viva 20 days ago
I think it's A. Seems straightforward.
JU
Junita 26 days ago
A feels right. Count gives a true average.
LO
Louis 1 month ago
I’m not sure about C. Average in the rate? Doesn’t fit.
PH
Phuong 1 month ago
A is definitely the best choice. It’s standard practice.
AN
Andrew 1 month ago
D is confusing. Why use average in the denominator?
LI
Lizette 2 months ago
I’m leaning towards A too. It’s clear and logical.
MI
Michal 2 months ago
Option B looks tempting, but I feel the naming is off.
CH
Christoper 2 months ago
I agree, A seems straightforward. Average needs both.
MI
Micaela 2 months ago
I think option A is correct. It makes sense to use sum and count.
LE
Leonardo 2 months ago
D) sounds off to me, not sure about that one.
CR
Crissy 2 months ago
Wait, is C) even a valid option?
WH
Whitney 3 months ago
I think B) makes more sense, though.
AL
Alease 3 months ago
A) is the right choice!
TR
Trina 3 months ago
How can you trust those rates over just raw counts?
LA
Lauran 3 months ago
Totally agree with A), it makes the most sense.
JA
Jaclyn 3 months ago
Wait, is there even an average metric in the options?
IN
In 3 months ago
I think B) is a better choice.
CL
Clare 4 months ago
A) is the correct formula!
SK
Skye 4 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.
SA
Salina 4 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.
SH
Shawna 4 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.
TR
Trina 4 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.
0/2000 characters

Save Cancel