"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/adodb/adodb/tests/test-perf.php Source File", "datetime" => "Sat Dec 2 19:22:26 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>

test-perf.php

00001 <?php
00002 
00003 include_once('../adodb-perf.inc.php');
00004 
00005 error_reporting(E_ALL);
00006 session_start();
00007 
00008 if (isset($_GET)) {
00009         foreach($_GET as $k => $v) {
00010                 if (strncmp($k,'test',4) == 0) $_SESSION['_db'] = $k;
00011         }
00012 } 
00013 
00014 if (isset($_SESSION['_db'])) {
00015         $_db = $_SESSION['_db'];
00016         $_GET[$_db] = 1;
00017         $$_db = 1;
00018 }
00019 
00020 echo "<h1>Performance Monitoring</h1>";
00021 include_once('testdatabases.inc.php');
00022 
00023 
00024 function testdb($db) 
00025 {
00026         if (!$db) return;
00027         echo "<font size=1>";print_r($db->ServerInfo()); echo " user=".$db->user."</font>";
00028         
00029         $perf = NewPerfMonitor($db); 
00030         
00031         # unit tests
00032         if (0) {
00033                 //$DB->debug=1;
00034                 echo "Data Cache Size=".$perf->DBParameter('data cache size').'<p>';
00035                 echo $perf->HealthCheck();
00036                 echo($perf->SuspiciousSQL());
00037                 echo($perf->ExpensiveSQL());
00038                 echo($perf->InvalidSQL());
00039                 echo $perf->Tables();
00040         
00041                 echo "<pre>";
00042                 echo $perf->HealthCheckCLI();
00043                 $perf->Poll(3);
00044                 die();
00045         }
00046         
00047         if ($perf) $perf->UI(3);
00048 }
00049  
00050 ?>