]> git.mjollnir.org Git - moodle.git/commitdiff
Script to look at database performanceusing ADOdb tools
authormoodler <moodler>
Wed, 19 Nov 2003 08:15:23 +0000 (08:15 +0000)
committermoodler <moodler>
Wed, 19 Nov 2003 08:15:23 +0000 (08:15 +0000)
admin/dbperformance.php [new file with mode: 0644]

diff --git a/admin/dbperformance.php b/admin/dbperformance.php
new file mode 100644 (file)
index 0000000..89377ce
--- /dev/null
@@ -0,0 +1,36 @@
+<?PHP  // $Id$
+       // dbperformance.php - shows latest ADOdb stats for the current server
+
+    require_once("../config.php");
+
+    require_login();
+
+    if (!isadmin()) {
+        error("Only the admin can use this page");
+    }
+
+    $strdatabaseperformance = get_string("databaseperformance");
+    $stradministration = get_string("administration");
+    $site = get_site();
+
+    if (isset($topframe)) {
+           print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", 
+                     "<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> Database performance");
+        exit;
+    }
+
+    if (isset($bottomframe) or isset($_GET['do'])) {
+        $perf =&NewPerfMonitor($db);
+        $perf->UI($pollsecs=5);
+        exit;
+    }
+
+?>
+<head>
+<title><?php echo "$site->shortname: $strdatabaseperformance" ?></title>
+</head>
+
+<frameset rows="80,*">
+   <frame src="dbperformance.php?topframe=true">
+   <frame src="dbperformance.php?bottomframe=true">
+</frameset>