-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is WindowedCount the right stat type to use in MetricsResourceMethodApplicationListener? #344
Comments
@splett2 Any thoughts on the question from Eric? |
seems reasonable to me. I would probably rename the existing CumulativeCount to request-rate and then the new cumulative count metric to request-total. |
Thanks @splett2. I will rename it to |
@ehumber |
Another approach is rely on Also, |
CC @rigelbm |
By default, an application is configured to keep two samples in a
SampledStat
, e.g.,WindowedCount
, each sample maintains a 30-second window. Typically, metrics are exposed byJmxReporter
. When the value of an MBean is being retrieved, it calls the stat'smeasure
method. InWindowedCount
,measure
simply combines all data points in all (two) samples to get the sum. Unless the MBean retrievals are well aligned with the start of a window with the intervals being (window size * # of samples), I don't see how it could report the right count.For instance:
T: 0----5----[10]----15----[20]----25----[30]
W: |-----1-----|------2------|------3-------|
Let's assume the window size is 10, the metrics get collected every 10 seconds.
Collection 1 at 15: it returns the sum of (full window 1 and half of window 2), i.e., 0-15
Collection 2 at 25: it returns the sum of (full window 2 and half of window 3), i.e., 10-25
In this example, the values between 10-15 are repeatedly reported.
Can anyone please verify if this is the right understanding?
The text was updated successfully, but these errors were encountered: