Skip to content

Commit

Permalink
Tweak scan stats report formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Oct 2, 2024
1 parent abc2d86 commit 94da6a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sql/stats.sh
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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"

0 comments on commit 94da6a4

Please sign in to comment.