From 7d64c09fae72f64fbee6d512d2ad681f99307954 Mon Sep 17 00:00:00 2001 From: Joe Presbrey Date: Sun, 18 May 2008 22:14:34 +0000 Subject: [PATCH] move question stats to database git-svn-id: svn://presbrey.mit.edu/sql/web/dev@158 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- tpl/index.php | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/tpl/index.php b/tpl/index.php index e7cb30f..f235d56 100644 --- a/tpl/index.php +++ b/tpl/index.php @@ -23,30 +23,24 @@ One nightly backup is available for your locker at /mit/sql/backup/LOCKER_
1) { + array_shift($qunits); + $v /= 1000; + } + printf('sql.mit.edu has served %.3f%s queries', $v, array_shift($qunits)); + $qunits = array('minutes', 'hours', 'days'); + $qdiv = array(60, 60, 24); + while (count($qdiv) && $t/$qdiv[0]>0) { + $t /= array_shift($qdiv); + $tunits = array_shift($qunits); + } + printf(' in the last %.2f %s (%.2f qps)', $t, $tunits, $qavg); } -$qavg = $v/$t; -$qunits = array('','k','M','G','T','P','E','Z','Y'); -while (count($qunits) && $v/1000>1) { - array_shift($qunits); - $v /= 1000; -} -printf('sql.mit.edu has served %.3f%s queries', $v, array_shift($qunits)); - -$qunits = array('minutes', 'hours', 'days'); -$qdiv = array(60, 60, 24); -while (count($qdiv) && $t/$qdiv[0]>0) { - $t /= array_shift($qdiv); - $tunits = array_shift($qunits); -} -printf(' in the last %.2f %s (%.2f qps)', $t, $tunits, $qavg); ?>
-- 2.45.1