Add $__unixEpochGroup macro to postgres datasource

This commit is contained in:
Sven Klemm
2018-08-13 12:08:14 +02:00
parent edb34a36a0
commit bfe28ee061
4 changed files with 37 additions and 0 deletions

View File

@ -57,6 +57,8 @@ Macros:
by setting fillvalue grafana will fill in missing values according to the interval
fillvalue can be either a literal value, NULL or previous; previous will fill in the previous seen value or NULL if none has been seen yet
- $__timeGroupAlias(column,'5m') -> (extract(epoch from column)/300)::bigint*300 AS "time"
- $__unixEpochGroup(column,'5m') -> floor(column/300)*300
- $__unixEpochGroupAlias(column,'5m') -> floor(column/300)*300 AS "time"
Example of group by and order by with $__timeGroup:
SELECT