-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to pass durations for as arguments to WITH template funct…
…ions Support using WITH template vars in the following places where duration can be passed: - Lookbehind windows in square brackets: `with (w=5m) m[w]` is transformed to `m[5m]` - Steps in square brackets: `with (step=5m) m[1h:step]` is transformed to `m[1h:5m]` - Offsets: `with (off=5m) m offset off` is transformed to `m offset 5m` Updates VictoriaMetrics/VictoriaMetrics#4025 Updates #12 Thanks to @lujiajing1126 for the initial implementation at #13 Note that this feature doesn't allow specifying dynamic durations in the following way: with (w = ((day_of_month()-1) * 24 + hour()) + "h") m[w] It allows using only static durations Support for dynamic durations requires significant refactoring of the code responsible for calculating rollups in `/api/v1/query_range` handler. It will be needed to use different lookbehind windows per each calculated data point per each `step`. Currently the code assumes that the lookbehind window is static across every calculated data point.
- Loading branch information
Showing
3 changed files
with
145 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters