sanwa 2021-12-30 11:34:09
grafana接入sls的同比实现
(*)| select
time,
to_unixtime(date_parse(concat(date_format(current_timestamp, '%Y-%m-%d '),time), '%Y-%m-%d %H:%i')) as t,
diff [1] as today,
diff [2] as yesterday,
diff [3] as rate
FROM (
select
time,
compare(pv, 86400) as diff
FROM (
select count(1) as pv , date_format(from_unixtime(__time__), '%H:%i') as time from log group by time
)
group by
time
)
order by
time