File: dbperformance.php

package info (click to toggle)
moodle 1.6.3-2%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 37,172 kB
  • ctags: 51,688
  • sloc: php: 231,916; sql: 5,631; xml: 2,688; sh: 1,185; perl: 638; makefile: 48; pascal: 36
file content (40 lines) | stat: -rw-r--r-- 1,242 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?PHP  // $Id: dbperformance.php,v 1.4 2006/03/06 10:02:59 skodak Exp $
       // dbperformance.php - shows latest ADOdb stats for the current server

    require_once('../config.php');

    $topframe    = optional_param('topframe', 0, PARAM_BOOL);
    $bottomframe = optional_param('bottomframe', 0, PARAM_BOOL);
    $do          = optional_param('do', '', PARAM_ALPHA);

    require_login();

    if (!isadmin()) {
        error("Only the admin can use this page");
    }

    $strdatabaseperformance = get_string("databaseperformance");
    $stradministration = get_string("administration");
    $site = get_site();

    if (!empty($topframe)) {
        print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", 
                     "<a target=\"$CFG->framename\" href=\"index.php\">$stradministration</a> -> Database performance");
        exit;
    }

    if (!empty($bottomframe) or !empty($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>