From 396061c063bb07ee4e0c0e85b9c158c881039288 Mon Sep 17 00:00:00 2001 From: Joe Presbrey Date: Thu, 24 May 2007 23:29:56 +0000 Subject: [PATCH] show service stats on index git-svn-id: svn://presbrey.mit.edu/sql/web/dev@134 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- tpl/index.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tpl/index.php b/tpl/index.php index 56e4e82..26ce4e8 100644 --- a/tpl/index.php +++ b/tpl/index.php @@ -21,6 +21,35 @@ However, the SIPB MySQL service should not be used to host critical applications One nightly backup is available for your locker at /mit/sql/backup/LOCKER_NAME. You should perform additional backups of your data using the shortjobs service or phpMyAdmin.

+
+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