From 94da6a4e07db79de184aa544e726853199c14467 Mon Sep 17 00:00:00 2001 From: Alexei Date: Tue, 1 Oct 2024 21:53:47 -0400 Subject: [PATCH] Tweak scan stats report formatting --- sql/stats.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/stats.sh b/sql/stats.sh index 130ebf9..9d88b43 100755 --- a/sql/stats.sh +++ b/sql/stats.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -sqlite3 badger.sqlite3 -batch "SELECT browser.name AS browser, +sqlite3 badger.sqlite3 -batch -header -column "SELECT start_time, end_time, + ((CAST(STRFTIME('%s', end_time) AS INT) - CAST(STRFTIME('%s', start_time) AS INT)) / 60 / 60) AS num_hours, + browser.name AS browser, no_blocking, num_sites, - COUNT(DISTINCT blocked_trackers.tracker_id) AS num_blocked, - ((CAST(STRFTIME('%s', end_time) AS INT) - CAST(STRFTIME('%s', start_time) AS INT)) / 60 / 60) AS num_hours, - start_time + COUNT(DISTINCT blocked_trackers.tracker_id) AS num_blocked FROM scan JOIN browser ON browser.id = scan.browser_id JOIN (SELECT scan.id AS scan_id, @@ -21,4 +21,4 @@ sqlite3 badger.sqlite3 -batch "SELECT browser.name AS browser, WHERE scan.daily_scan = 1 AND scan.start_time > DATETIME('now', '-30 day') GROUP BY scan_id - ORDER BY scan.start_time DESC" | column -s '|' -t + ORDER BY scan.start_time DESC"