mirror of
https://github.com/grafana/grafana.git
synced 2025-09-25 18:24:01 +08:00
add fillmode "last" to sql datasource
This adds a new fill mode last (last observation carried forward) for grafana to the sql datasources. This fill mode will fill in the last seen value in a series when a timepoint is missing or NULL if no value for that series has been seen yet.
This commit is contained in:
@ -53,7 +53,9 @@ Macros:
|
||||
- $__timeEpoch -> extract(epoch from column) as "time"
|
||||
- $__timeFilter(column) -> column BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:01:17Z'
|
||||
- $__unixEpochFilter(column) -> column >= 1492750877 AND column <= 1492750877
|
||||
- $__timeGroup(column,'5m') -> (extract(epoch from column)/300)::bigint*300
|
||||
- $__timeGroup(column,'5m'[, fillvalue]) -> (extract(epoch from column)/300)::bigint*300
|
||||
by setting fillvalue grafana will fill in missing values according to the interval
|
||||
fillvalue can be either a literal value, NULL or last; last will fill in the last seen value or NULL if none has been seen yet
|
||||
- $__timeGroupAlias(column,'5m') -> (extract(epoch from column)/300)::bigint*300 AS "time"
|
||||
|
||||
Example of group by and order by with $__timeGroup:
|
||||
|
Reference in New Issue
Block a user