From fe37e625d4972c6907a7dc2dc0f615e5fcedcf13 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 31 Jan 2014 23:38:29 +0100 Subject: [PATCH] add a basic stats CLI util --- tools/stats.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tools/stats.php diff --git a/tools/stats.php b/tools/stats.php new file mode 100755 index 00000000..438d9c8f --- /dev/null +++ b/tools/stats.php @@ -0,0 +1,30 @@ +fetch()) { + printf("%10s || ", $f['uri']); + foreach ($variants as list($term, $time)) { + $qq = query(sprintf("SELECT COUNT(*) as count FROM ``posts_%s`` WHERE time > %d", $f['uri'], time()-$time); + $c = $qq->fetch()['count']; + + printf("%8d | ", $c); + } + print("\n"); +}