From 0967597ff39c925bd746223b994922e632a0c98e Mon Sep 17 00:00:00 2001
From: Oscar Najera <hi@oscarnajera.com>
Date: Mon, 10 Feb 2025 02:08:51 +0100
Subject: stats for separate domains

---
 webstats/queries.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'webstats/queries.sql')

diff --git a/webstats/queries.sql b/webstats/queries.sql
index 5e16da0..5a8a0ae 100644
--- a/webstats/queries.sql
+++ b/webstats/queries.sql
@@ -30,3 +30,15 @@ FROM
     STATS
 GROUP BY
     1;
+
+-- name: activity-places
+-- timeseries of loaded places
+SELECT
+    (timestamp / 600) * 600 AS time,
+	count(page) FILTER (WHERE page LIKE 'http://localhost:4252%') AS stats,
+	count(page) FILTER (WHERE page LIKE 'http://localhost/%') AS stats_proxy,
+	count(page) FILTER (WHERE page LIKE 'http://localhost:1313%') AS blog
+FROM
+    STATS
+GROUP BY
+    1
-- 
cgit v1.2.3

