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
Selecting "last 10" or "last 30" minutes in Timeseries gauge gives incorrect window of data #155
Comments
I finally figured out why the ranges are being selected as they are. It's from the (((r.last-r.first)/_tick.to_f).ceil+1+overflow).times.map{ |n| tick_at(r.first + _tick*(n-1), _tick) } The first part calculates the number of tick intervals contained in the current range, and the It should be calling This explains why it was working for the "last 15" and "last 45" minute intervals in my example above. Since tick was set to 60, then retention=600 (which is 10 minutes), meaning the selections in which retention divided unevenly would get rounded up by At first I thought it was intentionally starting at one interval less than the start of the range, to be sure we aren't leaving out values in the range. But this doesn't make since, because On the other hand, since we're starting from 0, we would need to add one to n in order to go up to the number of tick intervals in the loop (which explains why it's doing So, if we just change I'll see if I can create a test for this and submit a patch. Basically though, I had the intervals as such (with a tick of 60 seconds => retention of 600 seconds): 30 minutes:actual range: 1375752990 to 1375754790 45 minutes:actual range: 1375752034 to 1375754734 Making the above change fixes both of these cases, returning the expected range. |
I think I figured out why going from one range to the next sometimes excludes data. I updated my
FnordMetric::GaugeCalculations#fraction_values_in
method with some debugging code as this:Now, when I click "last 10 minutes", I see this:
Then when I click "last 15 minutes", I see:
I may be wrong, but shouldn't going from last 10 minutes to last 15 minutes make the time range go back 5 more minutes, not forward?
Then I go up to "last 30 minutes", and I get:
And then "last 45 minutes" and the same thing happens again:
In other words, it's 4:29, and...
So, the problem is that "last 10 minutes" actually selects 10 minutes starting from 15 minutes ago, and "last 30 minutes" actually selects 30 minutes starting from 45 minutes ago, rather than selecting the last 10 or 30 minutes, respectively.
The text was updated successfully, but these errors were encountered: