Skip to content
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

Improvements for $timeSeries template; sub-second data selection for DATETIME64 #398

Closed
tdamsma opened this issue Dec 21, 2021 · 0 comments
Assignees
Milestone

Comments

@tdamsma
Copy link

tdamsma commented Dec 21, 2021

The default $timeSeries template rounds data to whole seconds, this seems entirely unnecessary. For a interval width of 50ms, the $timeSeries template resolves to:

(intDiv(toFloat64(time) * 1000, (1 * 1000)) * (1 * 1000))

So instead of using this $timeSeries template, I used the following:

(intDiv(toFloat64(time) * 1000, ${__interval_ms}) * ${__interval_ms})

This is translated to the following query:

intDiv(toFloat64(time) * 1000, 50) * 50

Looking at the code this is because the $interval variable is rounded to the nearest second. Perhaps a $interval_ms can be added as variable analog to how grafana both $__interval and $__interval_ms exist in grafana. And looking at the source, why is the grafana $__interval_ms not used as basis to compute these values?

@Slach Slach added this to the 2.5.0 milestone Jun 1, 2022
@Slach Slach self-assigned this Jun 1, 2022
@Slach Slach closed this as completed in 8224556 Jun 1, 2022
Slach added a commit that referenced this issue Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants