计算当前1小时和昨天同时段的网站访问量比值。其中,选择查询和分析的时间范围为
1小时(整点时间)
,
86400
表示当前时间减去86400秒(1天),
log
表示Logstore名称。
查询和分析语句
* |
SELECT
diff [1] AS today,
diff [2] AS yesterday,
diff [3] AS ratio
FROM (
SELECT
compare(PV, 86400) AS diff
FROM (
SELECT
count(*) AS PV
FROM log
查询和分析结果
- 3337.0表示当前1小时(例如2020-12-25 14:00:00~2020-12-25 15:00:00)的网站访问量。
- 3522.0表示昨天同时段(例如2020-12-24 14:00:00~2020-12-24 15:00:00)的网站访问量。
- 0.947473026689381表示当前1小时与昨天同时段的网站访问量比值。