Translated using Weblate.
[phpmyadmin.git] / server_status.php
blob24dcb9b08e0ca1488d0e6998400351e786944a9f
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * displays status variables with descriptions and some hints an optmizing
5 * + reset status variables
7 * @package PhpMyAdmin
8 */
10 /**
11 * no need for variables importing
12 * @ignore
14 if (! defined('PMA_NO_VARIABLES_IMPORT')) {
15 define('PMA_NO_VARIABLES_IMPORT', true);
18 if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
19 $GLOBALS['is_header_sent'] = true;
22 require_once './libraries/common.inc.php';
24 /**
25 * Ajax request
28 if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
29 // Send with correct charset
30 header('Content-Type: text/html; charset=UTF-8');
32 // real-time charting data
33 if (isset($_REQUEST['chart_data'])) {
34 switch($_REQUEST['type']) {
35 // Process and Connections realtime chart
36 case 'proc':
37 $c = PMA_DBI_fetch_result("SHOW GLOBAL STATUS WHERE Variable_name = 'Connections'", 0, 1);
38 $result = PMA_DBI_query('SHOW PROCESSLIST');
39 $num_procs = PMA_DBI_num_rows($result);
41 $ret = array(
42 'x' => microtime(true) * 1000,
43 'y_proc' => $num_procs,
44 'y_conn' => $c['Connections']
47 exit(json_encode($ret));
49 // Query realtime chart
50 case 'queries':
51 if (PMA_DRIZZLE) {
52 $sql = "SELECT concat('Com_', variable_name), variable_value
53 FROM data_dictionary.GLOBAL_STATEMENTS
54 WHERE variable_value > 0
55 UNION
56 SELECT variable_name, variable_value
57 FROM data_dictionary.GLOBAL_STATUS
58 WHERE variable_name = 'Questions'";
59 $queries = PMA_DBI_fetch_result($sql, 0, 1);
60 } else {
61 $queries = PMA_DBI_fetch_result(
62 "SHOW GLOBAL STATUS
63 WHERE (Variable_name LIKE 'Com_%' OR Variable_name = 'Questions')
64 AND Value > 0", 0, 1
67 cleanDeprecated($queries);
68 // admin commands are not queries
69 unset($queries['Com_admin_commands']);
70 $questions = $queries['Questions'];
71 unset($queries['Questions']);
73 //$sum=array_sum($queries);
74 $ret = array(
75 'x' => microtime(true) * 1000,
76 'y' => $questions,
77 'pointInfo' => $queries
80 exit(json_encode($ret));
82 // Traffic realtime chart
83 case 'traffic':
84 $traffic = PMA_DBI_fetch_result(
85 "SHOW GLOBAL STATUS
86 WHERE Variable_name = 'Bytes_received'
87 OR Variable_name = 'Bytes_sent'", 0, 1
90 $ret = array(
91 'x' => microtime(true) * 1000,
92 'y_sent' => $traffic['Bytes_sent'],
93 'y_received' => $traffic['Bytes_received']
96 exit(json_encode($ret));
98 // Data for the monitor
99 case 'chartgrid':
100 $ret = json_decode($_REQUEST['requiredData'], true);
101 $statusVars = array();
102 $serverVars = array();
103 $sysinfo = $cpuload = $memory = 0;
104 $pName = '';
106 /* Accumulate all required variables and data */
107 // For each chart
108 foreach ($ret as $chart_id => $chartNodes) {
109 // For each data series
110 foreach ($chartNodes as $node_id => $nodeDataPoints) {
111 // For each data point in the series (usually just 1)
112 foreach ($nodeDataPoints as $point_id => $dataPoint) {
113 $pName = $dataPoint['name'];
115 switch ($dataPoint['type']) {
116 /* We only collect the status and server variables here to
117 * read them all in one query, and only afterwards assign them.
118 * Also do some white list filtering on the names
120 case 'servervar':
121 if (!preg_match('/[^a-zA-Z_]+/', $pName)) {
122 $serverVars[] = $pName;
124 break;
126 case 'statusvar':
127 if (!preg_match('/[^a-zA-Z_]+/', $pName)) {
128 $statusVars[] = $pName;
130 break;
132 case 'proc':
133 $result = PMA_DBI_query('SHOW PROCESSLIST');
134 $ret[$chart_id][$node_id][$point_id]['value'] = PMA_DBI_num_rows($result);
135 break;
137 case 'cpu':
138 if (!$sysinfo) {
139 include_once 'libraries/sysinfo.lib.php';
140 $sysinfo = getSysInfo();
142 if (!$cpuload) {
143 $cpuload = $sysinfo->loadavg();
146 if (PHP_OS == 'Linux') {
147 $ret[$chart_id][$node_id][$point_id]['idle'] = $cpuload['idle'];
148 $ret[$chart_id][$node_id][$point_id]['busy'] = $cpuload['busy'];
149 } else
150 $ret[$chart_id][$node_id][$point_id]['value'] = $cpuload['loadavg'];
152 break;
154 case 'memory':
155 if (!$sysinfo) {
156 include_once 'libraries/sysinfo.lib.php';
157 $sysinfo = getSysInfo();
159 if (!$memory) {
160 $memory = $sysinfo->memory();
163 $ret[$chart_id][$node_id][$point_id]['value'] = $memory[$pName];
164 break;
165 } /* switch */
166 } /* foreach */
167 } /* foreach */
168 } /* foreach */
170 // Retrieve all required status variables
171 if (count($statusVars)) {
172 $statusVarValues = PMA_DBI_fetch_result(
173 "SHOW GLOBAL STATUS
174 WHERE Variable_name='" . implode("' OR Variable_name='", $statusVars) . "'", 0, 1
176 } else {
177 $statusVarValues = array();
180 // Retrieve all required server variables
181 if (count($serverVars)) {
182 $serverVarValues = PMA_DBI_fetch_result(
183 "SHOW GLOBAL VARIABLES
184 WHERE Variable_name='" . implode("' OR Variable_name='", $serverVars) . "'", 0, 1
186 } else {
187 $serverVarValues = array();
190 // ...and now assign them
191 foreach ($ret as $chart_id => $chartNodes) {
192 foreach ($chartNodes as $node_id => $nodeDataPoints) {
193 foreach ($nodeDataPoints as $point_id => $dataPoint) {
194 switch($dataPoint['type']) {
195 case 'statusvar':
196 $ret[$chart_id][$node_id][$point_id]['value'] = $statusVarValues[$dataPoint['name']];
197 break;
198 case 'servervar':
199 $ret[$chart_id][$node_id][$point_id]['value'] = $serverVarValues[$dataPoint['name']];
200 break;
206 $ret['x'] = microtime(true) * 1000;
208 exit(json_encode($ret));
212 if (isset($_REQUEST['log_data'])) {
213 if (PMA_MYSQL_INT_VERSION < 50106) {
214 /* FIXME: why this? */
215 exit('""');
218 $start = intval($_REQUEST['time_start']);
219 $end = intval($_REQUEST['time_end']);
221 if ($_REQUEST['type'] == 'slow') {
222 $q = 'SELECT start_time, user_host, Sec_to_Time(Sum(Time_to_Sec(query_time))) as query_time, Sec_to_Time(Sum(Time_to_Sec(lock_time))) as lock_time, '.
223 'SUM(rows_sent) AS rows_sent, SUM(rows_examined) AS rows_examined, db, sql_text, COUNT(sql_text) AS \'#\' '.
224 'FROM `mysql`.`slow_log` WHERE start_time > FROM_UNIXTIME(' . $start . ') '.
225 'AND start_time < FROM_UNIXTIME(' . $end . ') GROUP BY sql_text';
227 $result = PMA_DBI_try_query($q);
229 $return = array('rows' => array(), 'sum' => array());
230 $type = '';
232 while ($row = PMA_DBI_fetch_assoc($result)) {
233 $type = strtolower(substr($row['sql_text'], 0, strpos($row['sql_text'], ' ')));
235 switch($type) {
236 case 'insert':
237 case 'update':
238 // Cut off big inserts and updates, but append byte count therefor
239 if (strlen($row['sql_text']) > 220) {
240 $row['sql_text'] = substr($row['sql_text'], 0, 200)
241 . '... ['
242 . implode(' ', PMA_formatByteDown(strlen($row['sql_text']), 2, 2))
243 . ']';
245 break;
246 default:
247 break;
250 if (!isset($return['sum'][$type])) {
251 $return['sum'][$type] = 0;
253 $return['sum'][$type] += $row['#'];
254 $return['rows'][] = $row;
257 $return['sum']['TOTAL'] = array_sum($return['sum']);
258 $return['numRows'] = count($return['rows']);
260 PMA_DBI_free_result($result);
262 exit(json_encode($return));
265 if ($_REQUEST['type'] == 'general') {
266 $limitTypes = (isset($_REQUEST['limitTypes']) && $_REQUEST['limitTypes'])
267 ? 'AND argument REGEXP \'^(INSERT|SELECT|UPDATE|DELETE)\' ' : '';
269 $q = 'SELECT TIME(event_time) as event_time, user_host, thread_id, server_id, argument, count(argument) as \'#\' '.
270 'FROM `mysql`.`general_log` WHERE command_type=\'Query\' '.
271 'AND event_time > FROM_UNIXTIME(' . $start . ') AND event_time < FROM_UNIXTIME(' . $end . ') '.
272 $limitTypes . 'GROUP by argument'; // HAVING count > 1';
274 $result = PMA_DBI_try_query($q);
276 $return = array('rows' => array(), 'sum' => array());
277 $type = '';
278 $insertTables = array();
279 $insertTablesFirst = -1;
280 $i = 0;
281 $removeVars = isset($_REQUEST['removeVariables']) && $_REQUEST['removeVariables'];
283 while ($row = PMA_DBI_fetch_assoc($result)) {
284 preg_match('/^(\w+)\s/', $row['argument'], $match);
285 $type = strtolower($match[1]);
287 if (!isset($return['sum'][$type])) {
288 $return['sum'][$type] = 0;
290 $return['sum'][$type] += $row['#'];
292 switch($type) {
293 case 'insert':
294 // Group inserts if selected
295 if ($removeVars && preg_match('/^INSERT INTO (`|\'|"|)([^\s\\1]+)\\1/i', $row['argument'], $matches)) {
296 $insertTables[$matches[2]]++;
297 if ($insertTables[$matches[2]] > 1) {
298 $return['rows'][$insertTablesFirst]['#'] = $insertTables[$matches[2]];
300 // Add a ... to the end of this query to indicate that there's been other queries
301 if ($return['rows'][$insertTablesFirst]['argument'][strlen($return['rows'][$insertTablesFirst]['argument'])-1] != '.') {
302 $return['rows'][$insertTablesFirst]['argument'] .= '<br/>...';
305 // Group this value, thus do not add to the result list
306 continue 2;
307 } else {
308 $insertTablesFirst = $i;
309 $insertTables[$matches[2]] += $row['#'] - 1;
312 // No break here
314 case 'update':
315 // Cut off big inserts and updates, but append byte count therefor
316 if (strlen($row['argument']) > 220) {
317 $row['argument'] = substr($row['argument'], 0, 200)
318 . '... ['
319 . implode(' ', PMA_formatByteDown(strlen($row['argument'])), 2, 2)
320 . ']';
322 break;
324 default:
325 break;
328 $return['rows'][] = $row;
329 $i++;
332 $return['sum']['TOTAL'] = array_sum($return['sum']);
333 $return['numRows'] = count($return['rows']);
335 PMA_DBI_free_result($result);
337 exit(json_encode($return));
341 if (isset($_REQUEST['logging_vars'])) {
342 if (isset($_REQUEST['varName']) && isset($_REQUEST['varValue'])) {
343 $value = PMA_sqlAddslashes($_REQUEST['varValue']);
344 if (!is_numeric($value)) {
345 $value="'" . $value . "'";
348 if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName'])) {
349 PMA_DBI_query('SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value);
354 $loggingVars = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES WHERE Variable_name IN ("general_log","slow_query_log","long_query_time","log_output")', 0, 1);
355 exit(json_encode($loggingVars));
358 if (isset($_REQUEST['query_analyzer'])) {
359 $return = array();
361 if (strlen($_REQUEST['database'])) {
362 PMA_DBI_select_db($_REQUEST['database']);
365 if ($profiling = PMA_profilingSupported()) {
366 PMA_DBI_query('SET PROFILING=1;');
369 // Do not cache query
370 $query = preg_replace('/^(\s*SELECT)/i', '\\1 SQL_NO_CACHE', $_REQUEST['query']);
372 $result = PMA_DBI_try_query($query);
373 $return['affectedRows'] = $GLOBALS['cached_affected_rows'];
375 $result = PMA_DBI_try_query('EXPLAIN ' . $query);
376 while ($row = PMA_DBI_fetch_assoc($result)) {
377 $return['explain'][] = $row;
380 // In case an error happened
381 $return['error'] = PMA_DBI_getError();
383 PMA_DBI_free_result($result);
385 if ($profiling) {
386 $return['profiling'] = array();
387 $result = PMA_DBI_try_query('SELECT seq,state,duration FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID=1 ORDER BY seq');
388 while ($row = PMA_DBI_fetch_assoc($result)) {
389 $return['profiling'][]= $row;
391 PMA_DBI_free_result($result);
394 exit(json_encode($return));
397 if (isset($_REQUEST['advisor'])) {
398 include 'libraries/Advisor.class.php';
399 $advisor = new Advisor();
400 exit(json_encode($advisor->run()));
406 * Replication library
408 if (PMA_DRIZZLE) {
409 $server_master_status = false;
410 $server_slave_status = false;
411 } else {
412 include_once './libraries/replication.inc.php';
413 include_once './libraries/replication_gui.lib.php';
417 * JS Includes
420 $GLOBALS['js_include'][] = 'server_status.js';
421 $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.16.custom.js';
422 $GLOBALS['js_include'][] = 'jquery/jquery.tablesorter.js';
423 $GLOBALS['js_include'][] = 'jquery/jquery.cookie.js'; // For tab persistence
424 // Charting
425 $GLOBALS['js_include'][] = 'highcharts/highcharts.js';
426 /* Files required for chart exporting */
427 $GLOBALS['js_include'][] = 'highcharts/exporting.js';
428 /* < IE 9 doesn't support canvas natively */
429 if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
430 $GLOBALS['js_include'][] = 'canvg/flashcanvas.js';
432 $GLOBALS['js_include'][] = 'canvg/canvg.js';
435 * flush status variables if requested
437 if (isset($_REQUEST['flush'])) {
438 $_flush_commands = array(
439 'STATUS',
440 'TABLES',
441 'QUERY CACHE',
444 if (in_array($_REQUEST['flush'], $_flush_commands)) {
445 PMA_DBI_query('FLUSH ' . $_REQUEST['flush'] . ';');
447 unset($_flush_commands);
451 * Kills a selected process
453 if (!empty($_REQUEST['kill'])) {
454 if (PMA_DBI_try_query('KILL ' . $_REQUEST['kill'] . ';')) {
455 $message = PMA_Message::success(__('Thread %s was successfully killed.'));
456 } else {
457 $message = PMA_Message::error(__('phpMyAdmin was unable to kill thread %s. It probably has already been closed.'));
459 $message->addParam($_REQUEST['kill']);
460 //$message->display();
466 * get status from server
468 $server_status = PMA_DBI_fetch_result('SHOW GLOBAL STATUS', 0, 1);
469 if (PMA_DRIZZLE) {
470 // Drizzle doesn't put query statistics into variables, add it
471 $sql = "SELECT concat('Com_', variable_name), variable_value
472 FROM data_dictionary.GLOBAL_STATEMENTS";
473 $statements = PMA_DBI_fetch_result($sql, 0, 1);
474 $server_status = array_merge($server_status, $statements);
478 * for some calculations we require also some server settings
480 $server_variables = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES', 0, 1);
483 * cleanup of some deprecated values
485 cleanDeprecated($server_status);
488 * calculate some values
490 // Key_buffer_fraction
491 if (isset($server_status['Key_blocks_unused'])
492 && isset($server_variables['key_cache_block_size'])
493 && isset($server_variables['key_buffer_size'])
495 $server_status['Key_buffer_fraction_%']
496 = 100
497 - $server_status['Key_blocks_unused']
498 * $server_variables['key_cache_block_size']
499 / $server_variables['key_buffer_size']
500 * 100;
501 } elseif (isset($server_status['Key_blocks_used'])
502 && isset($server_variables['key_buffer_size'])) {
503 $server_status['Key_buffer_fraction_%']
504 = $server_status['Key_blocks_used']
505 * 1024
506 / $server_variables['key_buffer_size'];
509 // Ratio for key read/write
510 if (isset($server_status['Key_writes'])
511 && isset($server_status['Key_write_requests'])
512 && $server_status['Key_write_requests'] > 0
514 $server_status['Key_write_ratio_%'] = 100 * $server_status['Key_writes'] / $server_status['Key_write_requests'];
517 if (isset($server_status['Key_reads'])
518 && isset($server_status['Key_read_requests'])
519 && $server_status['Key_read_requests'] > 0
521 $server_status['Key_read_ratio_%'] = 100 * $server_status['Key_reads'] / $server_status['Key_read_requests'];
524 // Threads_cache_hitrate
525 if (isset($server_status['Threads_created'])
526 && isset($server_status['Connections'])
527 && $server_status['Connections'] > 0
530 $server_status['Threads_cache_hitrate_%']
531 = 100 - $server_status['Threads_created'] / $server_status['Connections'] * 100;
535 * split variables in sections
537 $allocations = array(
538 // variable name => section
539 // variable names match when they begin with the given string
541 'Com_' => 'com',
542 'Innodb_' => 'innodb',
543 'Ndb_' => 'ndb',
544 'Handler_' => 'handler',
545 'Qcache_' => 'qcache',
546 'Threads_' => 'threads',
547 'Slow_launch_threads' => 'threads',
549 'Binlog_cache_' => 'binlog_cache',
550 'Created_tmp_' => 'created_tmp',
551 'Key_' => 'key',
553 'Delayed_' => 'delayed',
554 'Not_flushed_delayed_rows' => 'delayed',
556 'Flush_commands' => 'query',
557 'Last_query_cost' => 'query',
558 'Slow_queries' => 'query',
559 'Queries' => 'query',
560 'Prepared_stmt_count' => 'query',
562 'Select_' => 'select',
563 'Sort_' => 'sort',
565 'Open_tables' => 'table',
566 'Opened_tables' => 'table',
567 'Open_table_definitions' => 'table',
568 'Opened_table_definitions' => 'table',
569 'Table_locks_' => 'table',
571 'Rpl_status' => 'repl',
572 'Slave_' => 'repl',
574 'Tc_' => 'tc',
576 'Ssl_' => 'ssl',
578 'Open_files' => 'files',
579 'Open_streams' => 'files',
580 'Opened_files' => 'files',
583 $sections = array(
584 // section => section name (description)
585 'com' => 'Com',
586 'query' => __('SQL query'),
587 'innodb' => 'InnoDB',
588 'ndb' => 'NDB',
589 'handler' => __('Handler'),
590 'qcache' => __('Query cache'),
591 'threads' => __('Threads'),
592 'binlog_cache' => __('Binary log'),
593 'created_tmp' => __('Temporary data'),
594 'delayed' => __('Delayed inserts'),
595 'key' => __('Key cache'),
596 'select' => __('Joins'),
597 'repl' => __('Replication'),
598 'sort' => __('Sorting'),
599 'table' => __('Tables'),
600 'tc' => __('Transaction coordinator'),
601 'files' => __('Files'),
602 'ssl' => 'SSL',
603 'other' => __('Other')
607 * define some needfull links/commands
609 // variable or section name => (name => url)
610 $links = array();
612 $links['table'][__('Flush (close) all tables')]
613 = $PMA_PHP_SELF . '?flush=TABLES&amp;' . PMA_generate_common_url();
614 $links['table'][__('Show open tables')]
615 = 'sql.php?sql_query=' . urlencode('SHOW OPEN TABLES') .
616 '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
618 if ($server_master_status) {
619 $links['repl'][__('Show slave hosts')]
620 = 'sql.php?sql_query=' . urlencode('SHOW SLAVE HOSTS') .
621 '&amp;goto=server_status.php&amp;' . PMA_generate_common_url();
622 $links['repl'][__('Show master status')] = '#replication_master';
624 if ($server_slave_status) {
625 $links['repl'][__('Show slave status')] = '#replication_slave';
628 $links['repl']['doc'] = 'replication';
630 $links['qcache'][__('Flush query cache')]
631 = $PMA_PHP_SELF . '?flush=' . urlencode('QUERY CACHE') . '&amp;' .
632 PMA_generate_common_url();
633 $links['qcache']['doc'] = 'query_cache';
635 //$links['threads'][__('Show processes')]
636 // = 'server_processlist.php?' . PMA_generate_common_url();
637 $links['threads']['doc'] = 'mysql_threads';
639 $links['key']['doc'] = 'myisam_key_cache';
641 $links['binlog_cache']['doc'] = 'binary_log';
643 $links['Slow_queries']['doc'] = 'slow_query_log';
645 $links['innodb'][__('Variables')]
646 = 'server_engines.php?engine=InnoDB&amp;' . PMA_generate_common_url();
647 $links['innodb'][__('InnoDB Status')]
648 = 'server_engines.php?engine=InnoDB&amp;page=Status&amp;' .
649 PMA_generate_common_url();
650 $links['innodb']['doc'] = 'innodb';
653 // Variable to contain all com_ variables (query statistics)
654 $used_queries = array();
656 // Variable to map variable names to their respective section name
657 // (used for js category filtering)
658 $allocationMap = array();
660 // Variable to mark used sections
661 $categoryUsed = array();
663 // sort vars into arrays
664 foreach ($server_status as $name => $value) {
665 $section_found = false;
666 foreach ($allocations as $filter => $section) {
667 if (strpos($name, $filter) !== false) {
668 $allocationMap[$name] = $section;
669 $categoryUsed[$section] = true;
670 $section_found = true;
671 if ($section == 'com' && $value > 0) {
672 $used_queries[$name] = $value;
674 break; // Only exits inner loop
677 if (!$section_found) {
678 $allocationMap[$name] = 'other';
679 $categoryUsed['other'] = true;
683 if (PMA_DRIZZLE) {
684 $used_queries = PMA_DBI_fetch_result(
685 'SELECT * FROM data_dictionary.global_statements',
689 unset($used_queries['admin_commands']);
690 } else {
691 // admin commands are not queries (e.g. they include COM_PING,
692 // which is excluded from $server_status['Questions'])
693 unset($used_queries['Com_admin_commands']);
696 /* Ajax request refresh */
697 if (isset($_REQUEST['show']) && isset($_REQUEST['ajax_request'])) {
698 switch($_REQUEST['show']) {
699 case 'query_statistics':
700 printQueryStatistics();
701 exit();
702 case 'server_traffic':
703 printServerTraffic();
704 exit();
705 case 'variables_table':
706 // Prints the variables table
707 printVariablesTable();
708 exit();
710 default:
711 break;
715 $server_db_isLocal = strtolower($cfg['Server']['host']) == 'localhost'
716 || $cfg['Server']['host'] == '127.0.0.1'
717 || $cfg['Server']['host'] == '::1';
719 PMA_AddJSVar(
720 'pma_token',
721 $_SESSION[' PMA_token ']
723 PMA_AddJSVar(
724 'url_query',
725 str_replace('&amp;', '&', PMA_generate_common_url($db))
727 PMA_AddJSVar(
728 'server_time_diff',
729 'new Date().getTime() - ' . (microtime(true) * 1000),
730 false
732 PMA_AddJSVar(
733 'server_os',
734 PHP_OS
736 PMA_AddJSVar(
737 'is_superuser',
738 PMA_isSuperuser()
740 PMA_AddJSVar(
741 'server_db_isLocal',
742 $server_db_isLocal
744 PMA_AddJSVar(
745 'profiling_docu',
746 PMA_showMySQLDocu('general-thread-states', 'general-thread-states')
748 PMA_AddJSVar(
749 'explain_docu',
750 PMA_showMySQLDocu('explain-output', 'explain-output')
754 * start output
758 * Does the common work
760 require './libraries/server_common.inc.php';
765 * Displays the links
767 require './libraries/server_links.inc.php';
770 <div id="serverstatus">
771 <h2><?php
773 * Displays the sub-page heading
775 if ($GLOBALS['cfg']['MainPageIconic']) {
776 echo PMA_getImage('s_status.png');
779 echo __('Runtime Information');
781 ?></h2>
782 <div id="serverStatusTabs">
783 <ul>
784 <li><a href="#statustabs_traffic"><?php echo __('Server'); ?></a></li>
785 <li><a href="#statustabs_queries"><?php echo __('Query statistics'); ?></a></li>
786 <li><a href="#statustabs_allvars"><?php echo __('All status variables'); ?></a></li>
787 <li class="jsfeature"><a href="#statustabs_charting"><?php echo __('Monitor'); ?></a></li>
788 <li class="jsfeature"><a href="#statustabs_advisor"><?php echo __('Advisor'); ?></a></li>
789 </ul>
791 <div id="statustabs_traffic" class="clearfloat">
792 <div class="buttonlinks jsfeature">
793 <a class="tabRefresh" href="<?php echo $PMA_PHP_SELF . '?show=server_traffic&amp;' . PMA_generate_common_url(); ?>" >
794 <img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
795 <?php echo __('Refresh'); ?>
796 </a>
797 <span class="refreshList" style="display:none;">
798 <label for="id_trafficChartRefresh"><?php echo __('Refresh rate: '); ?></label>
799 <?php refreshList('trafficChartRefresh'); ?>
800 </span>
802 <a class="tabChart livetrafficLink" href="#">
803 <?php echo __('Live traffic chart'); ?>
804 </a>
805 <a class="tabChart liveconnectionsLink" href="#">
806 <?php echo __('Live conn./process chart'); ?>
807 </a>
808 </div>
809 <div class="tabInnerContent">
810 <?php printServerTraffic(); ?>
811 </div>
812 </div>
813 <div id="statustabs_queries" class="clearfloat">
814 <div class="buttonlinks jsfeature">
815 <a class="tabRefresh" href="<?php echo $PMA_PHP_SELF . '?show=query_statistics&amp;' . PMA_generate_common_url(); ?>" >
816 <img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
817 <?php echo __('Refresh'); ?>
818 </a>
819 <span class="refreshList" style="display:none;">
820 <label for="id_queryChartRefresh"><?php echo __('Refresh rate: '); ?></label>
821 <?php refreshList('queryChartRefresh'); ?>
822 </span>
823 <a class="tabChart livequeriesLink" href="#">
824 <?php echo __('Live query chart'); ?>
825 </a>
826 </div>
827 <div class="tabInnerContent">
828 <?php printQueryStatistics(); ?>
829 </div>
830 </div>
831 <div id="statustabs_allvars" class="clearfloat">
832 <fieldset id="tableFilter" class="jsfeature">
833 <div class="buttonlinks">
834 <a class="tabRefresh" href="<?php echo $PMA_PHP_SELF . '?show=variables_table&amp;' . PMA_generate_common_url(); ?>" >
835 <img src="<?php echo $GLOBALS['pmaThemeImage'];?>ajax_clock_small.gif" alt="ajax clock" style="display: none;" />
836 <?php echo __('Refresh'); ?>
837 </a>
838 </div>
839 <legend><?php echo __('Filters'); ?></legend>
840 <div class="formelement">
841 <label for="filterText"><?php echo __('Containing the word:'); ?></label>
842 <input name="filterText" type="text" id="filterText" style="vertical-align: baseline;" />
843 </div>
844 <div class="formelement">
845 <input type="checkbox" name="filterAlert" id="filterAlert" />
846 <label for="filterAlert"><?php echo __('Show only alert values'); ?></label>
847 </div>
848 <div class="formelement">
849 <select id="filterCategory" name="filterCategory">
850 <option value=''><?php echo __('Filter by category...'); ?></option>
851 <?php
852 foreach ($sections as $section_id => $section_name) {
853 if (isset($categoryUsed[$section_id])) {
855 <option value='<?php echo $section_id; ?>'><?php echo $section_name; ?></option>
856 <?php
860 </select>
861 </div>
862 <div class="formelement">
863 <input type="checkbox" name="dontFormat" id="dontFormat" />
864 <label for="dontFormat"><?php echo __('Show unformatted values'); ?></label>
865 </div>
866 </fieldset>
867 <div id="linkSuggestions" class="defaultLinks" style="display:none">
868 <p class="notice"><?php echo __('Related links:'); ?>
869 <?php
870 foreach ($links as $section_name => $section_links) {
871 echo '<span class="status_' . $section_name . '"> ';
872 $i=0;
873 foreach ($section_links as $link_name => $link_url) {
874 if ($i > 0) {
875 echo ', ';
877 if ('doc' == $link_name) {
878 echo PMA_showMySQLDocu($link_url, $link_url);
879 } else {
880 echo '<a href="' . $link_url . '">' . $link_name . '</a>';
882 $i++;
884 echo '</span>';
886 unset($link_url, $link_name, $i);
888 </p>
889 </div>
890 <div class="tabInnerContent">
891 <?php printVariablesTable(); ?>
892 </div>
893 </div>
895 <div id="statustabs_charting" class="jsfeature">
896 <?php printMonitor(); ?>
897 </div>
899 <div id="statustabs_advisor" class="jsfeature">
900 <div class="tabLinks">
901 <?php echo PMA_getImage('play.png'); ?> <a href="#startAnalyzer"><?php echo __('Run analyzer'); ?></a>
902 <?php echo PMA_getImage('b_help.png'); ?> <a href="#openAdvisorInstructions"><?php echo __('Instructions'); ?></a>
903 </div>
904 <div class="tabInnerContent clearfloat">
905 </div>
906 <div id="advisorInstructionsDialog" style="display:none;">
907 <?php
908 echo '<p>';
909 echo __('The Advisor system can provide recommendations on server variables by analyzing the server status variables.');
910 echo '</p> <p>';
911 echo __('Do note however that this system provides recommendations based on simple calculations and by rule of thumb which may not necessarily apply to your system.');
912 echo '</p> <p>';
913 echo __('Prior to changing any of the configuration, be sure to know what you are changing (by reading the documentation) and how to undo the change. Wrong tuning can have a very negative effect on performance.');
914 echo '</p> <p>';
915 echo __('The best way to tune your system would be to change only one setting at a time, observe or benchmark your database, and undo the change if there was no clearly measurable improvement.');
916 echo '</p>';
918 </div>
919 </div>
920 </div>
921 </div>
923 <?php
925 function printQueryStatistics()
927 global $server_status, $used_queries, $url_query, $PMA_PHP_SELF;
929 $hour_factor = 3600 / $server_status['Uptime'];
931 $total_queries = array_sum($used_queries);
934 <h3 id="serverstatusqueries">
935 <?php
936 /* l10n: Questions is the name of a MySQL Status variable */
937 echo sprintf(__('Questions since startup: %s'), PMA_formatNumber($total_queries, 0)) . ' ';
938 echo PMA_showMySQLDocu('server-status-variables', 'server-status-variables', false, 'statvar_Questions');
940 <br />
941 <span>
942 <?php
943 echo '&oslash; ' . __('per hour') . ': ';
944 echo PMA_formatNumber($total_queries * $hour_factor, 0);
945 echo '<br />';
947 echo '&oslash; ' . __('per minute') . ': ';
948 echo PMA_formatNumber($total_queries * 60 / $server_status['Uptime'], 0);
949 echo '<br />';
951 if ($total_queries / $server_status['Uptime'] >= 1) {
952 echo '&oslash; ' . __('per second') . ': ';
953 echo PMA_formatNumber($total_queries / $server_status['Uptime'], 0);
956 </span>
957 </h3>
958 <?php
960 // reverse sort by value to show most used statements first
961 arsort($used_queries);
963 $odd_row = true;
964 $count_displayed_rows = 0;
965 $perc_factor = 100 / $total_queries; //(- $server_status['Connections']);
969 <table id="serverstatusqueriesdetails" class="data sortable noclick">
970 <col class="namecol" />
971 <col class="valuecol" span="3" />
972 <thead>
973 <tr><th><?php echo __('Statements'); ?></th>
974 <th><?php
975 /* l10n: # = Amount of queries */
976 echo __('#');
978 </th>
979 <th>&oslash; <?php echo __('per hour'); ?></th>
980 <th>%</th>
981 </tr>
982 </thead>
983 <tbody>
985 <?php
986 $chart_json = array();
987 $query_sum = array_sum($used_queries);
988 $other_sum = 0;
989 foreach ($used_queries as $name => $value) {
990 $odd_row = !$odd_row;
992 // For the percentage column, use Questions - Connections, because
993 // the number of connections is not an item of the Query types
994 // but is included in Questions. Then the total of the percentages is 100.
995 $name = str_replace(array('Com_', '_'), array('', ' '), $name);
997 // Group together values that make out less than 2% into "Other", but only if we have more than 6 fractions already
998 if ($value < $query_sum * 0.02 && count($chart_json)>6) {
999 $other_sum += $value;
1000 } else {
1001 $chart_json[$name] = $value;
1004 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
1005 <th class="name"><?php echo htmlspecialchars($name); ?></th>
1006 <td class="value"><?php echo htmlspecialchars(PMA_formatNumber($value, 5, 0, true)); ?></td>
1007 <td class="value"><?php echo
1008 htmlspecialchars(PMA_formatNumber($value * $hour_factor, 4, 1, true)); ?></td>
1009 <td class="value"><?php echo
1010 htmlspecialchars(PMA_formatNumber($value * $perc_factor, 0, 2)); ?>%</td>
1011 </tr>
1012 <?php
1015 </tbody>
1016 </table>
1018 <div id="serverstatusquerieschart">
1019 <span style="display:none;">
1020 <?php
1021 if ($other_sum > 0) {
1022 $chart_json[__('Other')] = $other_sum;
1025 echo json_encode($chart_json);
1027 </span>
1028 </div>
1029 <?php
1032 function printServerTraffic()
1034 global $server_status, $PMA_PHP_SELF;
1035 global $server_master_status, $server_slave_status, $replication_types;
1037 $hour_factor = 3600 / $server_status['Uptime'];
1040 * starttime calculation
1042 $start_time = PMA_DBI_fetch_value(
1043 'SELECT UNIX_TIMESTAMP() - ' . $server_status['Uptime']
1047 <h3><?php
1048 echo sprintf(
1049 __('Network traffic since startup: %s'),
1050 implode(' ', PMA_formatByteDown($server_status['Bytes_received'] + $server_status['Bytes_sent'], 3, 1))
1053 </h3>
1056 <?php
1057 echo sprintf(
1058 __('This MySQL server has been running for %1$s. It started up on %2$s.'),
1059 PMA_timespanFormat($server_status['Uptime']),
1060 PMA_localisedDate($start_time)
1061 ) . "\n";
1063 </p>
1065 <?php
1066 if ($server_master_status || $server_slave_status) {
1067 echo '<p class="notice">';
1068 if ($server_master_status && $server_slave_status) {
1069 echo __('This MySQL server works as <b>master</b> and <b>slave</b> in <b>replication</b> process.');
1070 } elseif ($server_master_status) {
1071 echo __('This MySQL server works as <b>master</b> in <b>replication</b> process.');
1072 } elseif ($server_slave_status) {
1073 echo __('This MySQL server works as <b>slave</b> in <b>replication</b> process.');
1075 echo ' ';
1076 echo __('For further information about replication status on the server, please visit the <a href="#replication">replication section</a>.');
1077 echo '</p>';
1080 /* if the server works as master or slave in replication process, display useful information */
1081 if ($server_master_status || $server_slave_status) {
1083 <hr class="clearfloat" />
1085 <h3><a name="replication"></a><?php echo __('Replication status'); ?></h3>
1086 <?php
1088 foreach ($replication_types as $type) {
1089 if (${"server_{$type}_status"}) {
1090 PMA_replication_print_status_table($type);
1093 unset($types);
1097 <table id="serverstatustraffic" class="data noclick">
1098 <thead>
1099 <tr>
1100 <th colspan="2"><?php echo __('Traffic') . '&nbsp;' . PMA_showHint(__('On a busy server, the byte counters may overrun, so those statistics as reported by the MySQL server may be incorrect.')); ?></th>
1101 <th>&oslash; <?php echo __('per hour'); ?></th>
1102 </tr>
1103 </thead>
1104 <tbody>
1105 <tr class="odd">
1106 <th class="name"><?php echo __('Received'); ?></th>
1107 <td class="value"><?php echo
1108 implode(' ',
1109 PMA_formatByteDown($server_status['Bytes_received'], 3, 1)); ?></td>
1110 <td class="value"><?php echo
1111 implode(' ',
1112 PMA_formatByteDown(
1113 $server_status['Bytes_received'] * $hour_factor, 3, 1)); ?></td>
1114 </tr>
1115 <tr class="even">
1116 <th class="name"><?php echo __('Sent'); ?></th>
1117 <td class="value"><?php echo
1118 implode(' ',
1119 PMA_formatByteDown($server_status['Bytes_sent'], 3, 1)); ?></td>
1120 <td class="value"><?php echo
1121 implode(' ',
1122 PMA_formatByteDown(
1123 $server_status['Bytes_sent'] * $hour_factor, 3, 1)); ?></td>
1124 </tr>
1125 <tr class="odd">
1126 <th class="name"><?php echo __('Total'); ?></th>
1127 <td class="value"><?php echo
1128 implode(' ',
1129 PMA_formatByteDown(
1130 $server_status['Bytes_received'] + $server_status['Bytes_sent'], 3, 1)
1131 ); ?></td>
1132 <td class="value"><?php echo
1133 implode(' ',
1134 PMA_formatByteDown(
1135 ($server_status['Bytes_received'] + $server_status['Bytes_sent'])
1136 * $hour_factor, 3, 1)
1137 ); ?></td>
1138 </tr>
1139 </tbody>
1140 </table>
1142 <table id="serverstatusconnections" class="data noclick">
1143 <thead>
1144 <tr>
1145 <th colspan="2"><?php echo __('Connections'); ?></th>
1146 <th>&oslash; <?php echo __('per hour'); ?></th>
1147 <th>%</th>
1148 </tr>
1149 </thead>
1150 <tbody>
1151 <tr class="odd">
1152 <th class="name"><?php echo __('max. concurrent connections'); ?></th>
1153 <td class="value"><?php echo
1154 PMA_formatNumber($server_status['Max_used_connections'], 0); ?> </td>
1155 <td class="value">--- </td>
1156 <td class="value">--- </td>
1157 </tr>
1158 <tr class="even">
1159 <th class="name"><?php echo __('Failed attempts'); ?></th>
1160 <td class="value"><?php echo
1161 PMA_formatNumber($server_status['Aborted_connects'], 4, 1, true); ?></td>
1162 <td class="value"><?php echo
1163 PMA_formatNumber($server_status['Aborted_connects'] * $hour_factor,
1164 4, 2, true); ?></td>
1165 <td class="value"><?php echo
1166 $server_status['Connections'] > 0
1167 ? PMA_formatNumber(
1168 $server_status['Aborted_connects'] * 100 / $server_status['Connections'],
1169 0, 2, true) . '%'
1170 : '--- '; ?></td>
1171 </tr>
1172 <tr class="odd">
1173 <th class="name"><?php echo __('Aborted'); ?></th>
1174 <td class="value"><?php echo
1175 PMA_formatNumber($server_status['Aborted_clients'], 4, 1, true); ?></td>
1176 <td class="value"><?php echo
1177 PMA_formatNumber($server_status['Aborted_clients'] * $hour_factor,
1178 4, 2, true); ?></td>
1179 <td class="value"><?php echo
1180 $server_status['Connections'] > 0
1181 ? PMA_formatNumber(
1182 $server_status['Aborted_clients'] * 100 / $server_status['Connections'],
1183 0, 2, true) . '%'
1184 : '--- '; ?></td>
1185 </tr>
1186 <tr class="even">
1187 <th class="name"><?php echo __('Total'); ?></th>
1188 <td class="value"><?php echo
1189 PMA_formatNumber($server_status['Connections'], 4, 0); ?></td>
1190 <td class="value"><?php echo
1191 PMA_formatNumber($server_status['Connections'] * $hour_factor,
1192 4, 2); ?></td>
1193 <td class="value"><?php echo
1194 PMA_formatNumber(100, 0, 2); ?>%</td>
1195 </tr>
1196 </tbody>
1197 </table>
1198 <?php
1200 $url_params = array();
1202 $show_full_sql = !empty($_REQUEST['full']);
1203 if ($show_full_sql) {
1204 $url_params['full'] = 1;
1205 $full_text_link = 'server_status.php' . PMA_generate_common_url(array(), 'html', '?');
1206 } else {
1207 $full_text_link = 'server_status.php' . PMA_generate_common_url(array('full' => 1));
1209 if (PMA_DRIZZLE) {
1210 $sql_query = "SELECT
1211 p.id AS Id,
1212 p.username AS User,
1213 p.host AS Host,
1214 p.db AS db,
1215 p.command AS Command,
1216 p.time AS Time,
1217 p.state AS State,
1218 " . ($show_full_sql ? 's.query' : 'left(p.info, ' . (int)$GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] . ')') . " AS Info
1219 FROM data_dictionary.PROCESSLIST p
1220 " . ($show_full_sql ? 'LEFT JOIN data_dictionary.SESSIONS s ON s.session_id = p.id' : '');
1221 } else {
1222 $sql_query = $show_full_sql
1223 ? 'SHOW FULL PROCESSLIST'
1224 : 'SHOW PROCESSLIST';
1226 $result = PMA_DBI_query($sql_query);
1229 * Displays the page
1232 <table id="tableprocesslist" class="data clearfloat noclick">
1233 <thead>
1234 <tr>
1235 <th><?php echo __('Processes'); ?></th>
1236 <th><?php echo __('ID'); ?></th>
1237 <th><?php echo __('User'); ?></th>
1238 <th><?php echo __('Host'); ?></th>
1239 <th><?php echo __('Database'); ?></th>
1240 <th><?php echo __('Command'); ?></th>
1241 <th><?php echo __('Time'); ?></th>
1242 <th><?php echo __('Status'); ?></th>
1243 <th><?php
1244 echo __('SQL query');
1245 if (! PMA_DRIZZLE) {
1247 <a href="<?php echo $full_text_link; ?>"
1248 title="<?php echo $show_full_sql ? __('Truncate Shown Queries') : __('Show Full Queries'); ?>">
1249 <img src="<?php echo $GLOBALS['pmaThemeImage'] . 's_' . ($show_full_sql ? 'partial' : 'full'); ?>text.png"
1250 alt="<?php echo $show_full_sql ? __('Truncate Shown Queries') : __('Show Full Queries'); ?>" />
1251 </a>
1252 <?php } ?>
1253 </th>
1254 </tr>
1255 </thead>
1256 <tbody>
1257 <?php
1258 $odd_row = true;
1259 while ($process = PMA_DBI_fetch_assoc($result)) {
1260 $url_params['kill'] = $process['Id'];
1261 $kill_process = 'server_status.php' . PMA_generate_common_url($url_params);
1263 <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
1264 <td><a href="<?php echo $kill_process ; ?>"><?php echo __('Kill'); ?></a></td>
1265 <td class="value"><?php echo $process['Id']; ?></td>
1266 <td><?php echo $process['User']; ?></td>
1267 <td><?php echo $process['Host']; ?></td>
1268 <td><?php echo ((! isset($process['db']) || ! strlen($process['db'])) ? '<i>' . __('None') . '</i>' : $process['db']); ?></td>
1269 <td><?php echo $process['Command']; ?></td>
1270 <td class="value"><?php echo $process['Time']; ?></td>
1271 <td><?php echo (empty($process['State']) ? '---' : $process['State']); ?></td>
1272 <td>
1273 <?php
1274 if (empty($process['Info'])) {
1275 echo '---';
1276 } else {
1277 if (!$show_full_sql && strlen($process['Info']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
1278 echo htmlspecialchars(substr($process['Info'], 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'])) . '[...]';
1279 } else {
1280 echo PMA_SQP_formatHtml(PMA_SQP_parse($process['Info']));
1284 </td>
1285 </tr>
1286 <?php
1287 $odd_row = ! $odd_row;
1290 </tbody>
1291 </table>
1292 <?php
1295 function printVariablesTable()
1297 global $server_status, $server_variables, $allocationMap, $links;
1299 * Messages are built using the message name
1301 $strShowStatus = array(
1302 'Aborted_clients' => __('The number of connections that were aborted because the client died without closing the connection properly.'),
1303 'Aborted_connects' => __('The number of failed attempts to connect to the MySQL server.'),
1304 'Binlog_cache_disk_use' => __('The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.'),
1305 'Binlog_cache_use' => __('The number of transactions that used the temporary binary log cache.'),
1306 'Connections' => __('The number of connection attempts (successful or not) to the MySQL server.'),
1307 'Created_tmp_disk_tables' => __('The number of temporary tables on disk created automatically by the server while executing statements. If Created_tmp_disk_tables is big, you may want to increase the tmp_table_size value to cause temporary tables to be memory-based instead of disk-based.'),
1308 'Created_tmp_files' => __('How many temporary files mysqld has created.'),
1309 'Created_tmp_tables' => __('The number of in-memory temporary tables created automatically by the server while executing statements.'),
1310 'Delayed_errors' => __('The number of rows written with INSERT DELAYED for which some error occurred (probably duplicate key).'),
1311 'Delayed_insert_threads' => __('The number of INSERT DELAYED handler threads in use. Every different table on which one uses INSERT DELAYED gets its own thread.'),
1312 'Delayed_writes' => __('The number of INSERT DELAYED rows written.'),
1313 'Flush_commands' => __('The number of executed FLUSH statements.'),
1314 'Handler_commit' => __('The number of internal COMMIT statements.'),
1315 'Handler_delete' => __('The number of times a row was deleted from a table.'),
1316 'Handler_discover' => __('The MySQL server can ask the NDB Cluster storage engine if it knows about a table with a given name. This is called discovery. Handler_discover indicates the number of time tables have been discovered.'),
1317 'Handler_read_first' => __('The number of times the first entry was read from an index. If this is high, it suggests that the server is doing a lot of full index scans; for example, SELECT col1 FROM foo, assuming that col1 is indexed.'),
1318 'Handler_read_key' => __('The number of requests to read a row based on a key. If this is high, it is a good indication that your queries and tables are properly indexed.'),
1319 'Handler_read_next' => __('The number of requests to read the next row in key order. This is incremented if you are querying an index column with a range constraint or if you are doing an index scan.'),
1320 'Handler_read_prev' => __('The number of requests to read the previous row in key order. This read method is mainly used to optimize ORDER BY ... DESC.'),
1321 'Handler_read_rnd' => __('The number of requests to read a row based on a fixed position. This is high if you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan whole tables or you have joins that don\'t use keys properly.'),
1322 'Handler_read_rnd_next' => __('The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.'),
1323 'Handler_rollback' => __('The number of internal ROLLBACK statements.'),
1324 'Handler_update' => __('The number of requests to update a row in a table.'),
1325 'Handler_write' => __('The number of requests to insert a row in a table.'),
1326 'Innodb_buffer_pool_pages_data' => __('The number of pages containing data (dirty or clean).'),
1327 'Innodb_buffer_pool_pages_dirty' => __('The number of pages currently dirty.'),
1328 'Innodb_buffer_pool_pages_flushed' => __('The number of buffer pool pages that have been requested to be flushed.'),
1329 'Innodb_buffer_pool_pages_free' => __('The number of free pages.'),
1330 'Innodb_buffer_pool_pages_latched' => __('The number of latched pages in InnoDB buffer pool. These are pages currently being read or written or that can\'t be flushed or removed for some other reason.'),
1331 'Innodb_buffer_pool_pages_misc' => __('The number of pages busy because they have been allocated for administrative overhead such as row locks or the adaptive hash index. This value can also be calculated as Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free - Innodb_buffer_pool_pages_data.'),
1332 'Innodb_buffer_pool_pages_total' => __('Total size of buffer pool, in pages.'),
1333 'Innodb_buffer_pool_read_ahead_rnd' => __('The number of "random" read-aheads InnoDB initiated. This happens when a query is to scan a large portion of a table but in random order.'),
1334 'Innodb_buffer_pool_read_ahead_seq' => __('The number of sequential read-aheads InnoDB initiated. This happens when InnoDB does a sequential full table scan.'),
1335 'Innodb_buffer_pool_read_requests' => __('The number of logical read requests InnoDB has done.'),
1336 'Innodb_buffer_pool_reads' => __('The number of logical reads that InnoDB could not satisfy from buffer pool and had to do a single-page read.'),
1337 'Innodb_buffer_pool_wait_free' => __('Normally, writes to the InnoDB buffer pool happen in the background. However, if it\'s necessary to read or create a page and no clean pages are available, it\'s necessary to wait for pages to be flushed first. This counter counts instances of these waits. If the buffer pool size was set properly, this value should be small.'),
1338 'Innodb_buffer_pool_write_requests' => __('The number writes done to the InnoDB buffer pool.'),
1339 'Innodb_data_fsyncs' => __('The number of fsync() operations so far.'),
1340 'Innodb_data_pending_fsyncs' => __('The current number of pending fsync() operations.'),
1341 'Innodb_data_pending_reads' => __('The current number of pending reads.'),
1342 'Innodb_data_pending_writes' => __('The current number of pending writes.'),
1343 'Innodb_data_read' => __('The amount of data read so far, in bytes.'),
1344 'Innodb_data_reads' => __('The total number of data reads.'),
1345 'Innodb_data_writes' => __('The total number of data writes.'),
1346 'Innodb_data_written' => __('The amount of data written so far, in bytes.'),
1347 'Innodb_dblwr_pages_written' => __('The number of pages that have been written for doublewrite operations.'),
1348 'Innodb_dblwr_writes' => __('The number of doublewrite operations that have been performed.'),
1349 'Innodb_log_waits' => __('The number of waits we had because log buffer was too small and we had to wait for it to be flushed before continuing.'),
1350 'Innodb_log_write_requests' => __('The number of log write requests.'),
1351 'Innodb_log_writes' => __('The number of physical writes to the log file.'),
1352 'Innodb_os_log_fsyncs' => __('The number of fsync() writes done to the log file.'),
1353 'Innodb_os_log_pending_fsyncs' => __('The number of pending log file fsyncs.'),
1354 'Innodb_os_log_pending_writes' => __('Pending log file writes.'),
1355 'Innodb_os_log_written' => __('The number of bytes written to the log file.'),
1356 'Innodb_pages_created' => __('The number of pages created.'),
1357 'Innodb_page_size' => __('The compiled-in InnoDB page size (default 16KB). Many values are counted in pages; the page size allows them to be easily converted to bytes.'),
1358 'Innodb_pages_read' => __('The number of pages read.'),
1359 'Innodb_pages_written' => __('The number of pages written.'),
1360 'Innodb_row_lock_current_waits' => __('The number of row locks currently being waited for.'),
1361 'Innodb_row_lock_time_avg' => __('The average time to acquire a row lock, in milliseconds.'),
1362 'Innodb_row_lock_time' => __('The total time spent in acquiring row locks, in milliseconds.'),
1363 'Innodb_row_lock_time_max' => __('The maximum time to acquire a row lock, in milliseconds.'),
1364 'Innodb_row_lock_waits' => __('The number of times a row lock had to be waited for.'),
1365 'Innodb_rows_deleted' => __('The number of rows deleted from InnoDB tables.'),
1366 'Innodb_rows_inserted' => __('The number of rows inserted in InnoDB tables.'),
1367 'Innodb_rows_read' => __('The number of rows read from InnoDB tables.'),
1368 'Innodb_rows_updated' => __('The number of rows updated in InnoDB tables.'),
1369 'Key_blocks_not_flushed' => __('The number of key blocks in the key cache that have changed but haven\'t yet been flushed to disk. It used to be known as Not_flushed_key_blocks.'),
1370 'Key_blocks_unused' => __('The number of unused blocks in the key cache. You can use this value to determine how much of the key cache is in use.'),
1371 'Key_blocks_used' => __('The number of used blocks in the key cache. This value is a high-water mark that indicates the maximum number of blocks that have ever been in use at one time.'),
1372 'Key_read_requests' => __('The number of requests to read a key block from the cache.'),
1373 'Key_reads' => __('The number of physical reads of a key block from disk. If Key_reads is big, then your key_buffer_size value is probably too small. The cache miss rate can be calculated as Key_reads/Key_read_requests.'),
1374 'Key_write_requests' => __('The number of requests to write a key block to the cache.'),
1375 'Key_writes' => __('The number of physical writes of a key block to disk.'),
1376 'Last_query_cost' => __('The total cost of the last compiled query as computed by the query optimizer. Useful for comparing the cost of different query plans for the same query. The default value of 0 means that no query has been compiled yet.'),
1377 'Max_used_connections' => __('The maximum number of connections that have been in use simultaneously since the server started.'),
1378 'Not_flushed_delayed_rows' => __('The number of rows waiting to be written in INSERT DELAYED queues.'),
1379 'Opened_tables' => __('The number of tables that have been opened. If opened tables is big, your table cache value is probably too small.'),
1380 'Open_files' => __('The number of files that are open.'),
1381 'Open_streams' => __('The number of streams that are open (used mainly for logging).'),
1382 'Open_tables' => __('The number of tables that are open.'),
1383 'Qcache_free_blocks' => __('The number of free memory blocks in query cache. High numbers can indicate fragmentation issues, which may be solved by issuing a FLUSH QUERY CACHE statement.'),
1384 'Qcache_free_memory' => __('The amount of free memory for query cache.'),
1385 'Qcache_hits' => __('The number of cache hits.'),
1386 'Qcache_inserts' => __('The number of queries added to the cache.'),
1387 'Qcache_lowmem_prunes' => __('The number of queries that have been removed from the cache to free up memory for caching new queries. This information can help you tune the query cache size. The query cache uses a least recently used (LRU) strategy to decide which queries to remove from the cache.'),
1388 'Qcache_not_cached' => __('The number of non-cached queries (not cachable, or not cached due to the query_cache_type setting).'),
1389 'Qcache_queries_in_cache' => __('The number of queries registered in the cache.'),
1390 'Qcache_total_blocks' => __('The total number of blocks in the query cache.'),
1391 'Rpl_status' => __('The status of failsafe replication (not yet implemented).'),
1392 'Select_full_join' => __('The number of joins that do not use indexes. If this value is not 0, you should carefully check the indexes of your tables.'),
1393 'Select_full_range_join' => __('The number of joins that used a range search on a reference table.'),
1394 'Select_range_check' => __('The number of joins without keys that check for key usage after each row. (If this is not 0, you should carefully check the indexes of your tables.)'),
1395 'Select_range' => __('The number of joins that used ranges on the first table. (It\'s normally not critical even if this is big.)'),
1396 'Select_scan' => __('The number of joins that did a full scan of the first table.'),
1397 'Slave_open_temp_tables' => __('The number of temporary tables currently open by the slave SQL thread.'),
1398 'Slave_retried_transactions' => __('Total (since startup) number of times the replication slave SQL thread has retried transactions.'),
1399 'Slave_running' => __('This is ON if this server is a slave that is connected to a master.'),
1400 'Slow_launch_threads' => __('The number of threads that have taken more than slow_launch_time seconds to create.'),
1401 'Slow_queries' => __('The number of queries that have taken more than long_query_time seconds.'),
1402 'Sort_merge_passes' => __('The number of merge passes the sort algorithm has had to do. If this value is large, you should consider increasing the value of the sort_buffer_size system variable.'),
1403 'Sort_range' => __('The number of sorts that were done with ranges.'),
1404 'Sort_rows' => __('The number of sorted rows.'),
1405 'Sort_scan' => __('The number of sorts that were done by scanning the table.'),
1406 'Table_locks_immediate' => __('The number of times that a table lock was acquired immediately.'),
1407 'Table_locks_waited' => __('The number of times that a table lock could not be acquired immediately and a wait was needed. If this is high, and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.'),
1408 'Threads_cached' => __('The number of threads in the thread cache. The cache hit rate can be calculated as Threads_created/Connections. If this value is red you should raise your thread_cache_size.'),
1409 'Threads_connected' => __('The number of currently open connections.'),
1410 'Threads_created' => __('The number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value. (Normally this doesn\'t give a notable performance improvement if you have a good thread implementation.)'),
1411 'Threads_running' => __('The number of threads that are not sleeping.')
1415 * define some alerts
1417 // name => max value before alert
1418 $alerts = array(
1419 // lower is better
1420 // variable => max value
1421 'Aborted_clients' => 0,
1422 'Aborted_connects' => 0,
1424 'Binlog_cache_disk_use' => 0,
1426 'Created_tmp_disk_tables' => 0,
1428 'Handler_read_rnd' => 0,
1429 'Handler_read_rnd_next' => 0,
1431 'Innodb_buffer_pool_pages_dirty' => 0,
1432 'Innodb_buffer_pool_reads' => 0,
1433 'Innodb_buffer_pool_wait_free' => 0,
1434 'Innodb_log_waits' => 0,
1435 'Innodb_row_lock_time_avg' => 10, // ms
1436 'Innodb_row_lock_time_max' => 50, // ms
1437 'Innodb_row_lock_waits' => 0,
1439 'Slow_queries' => 0,
1440 'Delayed_errors' => 0,
1441 'Select_full_join' => 0,
1442 'Select_range_check' => 0,
1443 'Sort_merge_passes' => 0,
1444 'Opened_tables' => 0,
1445 'Table_locks_waited' => 0,
1446 'Qcache_lowmem_prunes' => 0,
1448 'Qcache_free_blocks' => isset($server_status['Qcache_total_blocks']) ? $server_status['Qcache_total_blocks'] / 5 : 0,
1449 'Slow_launch_threads' => 0,
1451 // depends on Key_read_requests
1452 // normaly lower then 1:0.01
1453 'Key_reads' => isset($server_status['Key_read_requests']) ? (0.01 * $server_status['Key_read_requests']) : 0,
1454 // depends on Key_write_requests
1455 // normaly nearly 1:1
1456 'Key_writes' => isset($server_status['Key_write_requests']) ? (0.9 * $server_status['Key_write_requests']) : 0,
1458 'Key_buffer_fraction' => 0.5,
1460 // alert if more than 95% of thread cache is in use
1461 'Threads_cached' => isset($server_variables['thread_cache_size']) ? 0.95 * $server_variables['thread_cache_size'] : 0
1463 // higher is better
1464 // variable => min value
1465 //'Handler read key' => '> ',
1469 <table class="data sortable noclick" id="serverstatusvariables">
1470 <col class="namecol" />
1471 <col class="valuecol" />
1472 <col class="descrcol" />
1473 <thead>
1474 <tr>
1475 <th><?php echo __('Variable'); ?></th>
1476 <th><?php echo __('Value'); ?></th>
1477 <th><?php echo __('Description'); ?></th>
1478 </tr>
1479 </thead>
1480 <tbody>
1481 <?php
1483 $odd_row = false;
1484 foreach ($server_status as $name => $value) {
1485 $odd_row = !$odd_row;
1487 <tr class="<?php echo $odd_row ? 'odd' : 'even'; echo isset($allocationMap[$name])?' s_' . $allocationMap[$name]:''; ?>">
1488 <th class="name"><?php echo htmlspecialchars(str_replace('_', ' ', $name)) . PMA_showMySQLDocu('server-status-variables', 'server-status-variables', false, 'statvar_' . $name); ?>
1489 </th>
1490 <td class="value"><span class="formatted"><?php
1491 if (isset($alerts[$name])) {
1492 if ($value > $alerts[$name]) {
1493 echo '<span class="attention">';
1494 } else {
1495 echo '<span class="allfine">';
1498 if ('%' === substr($name, -1, 1)) {
1499 echo htmlspecialchars(PMA_formatNumber($value, 0, 2)) . ' %';
1500 } elseif (strpos($name, 'Uptime') !== false) {
1501 echo htmlspecialchars(PMA_timespanFormat($value));
1502 } elseif (is_numeric($value) && $value == (int) $value && $value > 1000) {
1503 echo htmlspecialchars(PMA_formatNumber($value, 3, 1));
1504 } elseif (is_numeric($value) && $value == (int) $value) {
1505 echo htmlspecialchars(PMA_formatNumber($value, 3, 0));
1506 } elseif (is_numeric($value)) {
1507 echo htmlspecialchars(PMA_formatNumber($value, 3, 1));
1508 } else {
1509 echo htmlspecialchars($value);
1511 if (isset($alerts[$name])) {
1512 echo '</span>';
1514 ?></span><span style="display:none;" class="original"><?php echo $value; ?></span>
1515 </td>
1516 <td class="descr">
1517 <?php
1518 if (isset($strShowStatus[$name ])) {
1519 echo $strShowStatus[$name];
1522 if (isset($links[$name])) {
1523 foreach ($links[$name] as $link_name => $link_url) {
1524 if ('doc' == $link_name) {
1525 echo PMA_showMySQLDocu($link_url, $link_url);
1526 } else {
1527 echo ' <a href="' . $link_url . '">' . $link_name . '</a>' .
1528 "\n";
1531 unset($link_url, $link_name);
1534 </td>
1535 </tr>
1536 <?php
1539 </tbody>
1540 </table>
1541 <?php
1544 function printMonitor()
1546 global $server_status, $server_db_isLocal;
1548 <div class="tabLinks" style="display:none;">
1549 <a href="#pauseCharts">
1550 <?php echo PMA_getImage('play.png'); ?>
1551 <?php echo __('Start Monitor'); ?>
1552 </a>
1553 <a href="#settingsPopup" rel="popupLink" style="display:none;">
1554 <?php echo PMA_getImage('s_cog.png'); ?>
1555 <?php echo __('Settings'); ?>
1556 </a>
1557 <?php if (!PMA_DRIZZLE) { ?>
1558 <a href="#monitorInstructionsDialog">
1559 <?php echo PMA_getImage('b_help.png'); ?>
1560 <?php echo __('Instructions/Setup'); ?>
1561 </a>
1562 <?php } ?>
1563 <a href="#endChartEditMode" style="display:none;">
1564 <?php echo PMA_getImage('s_okay.png'); ?>
1565 <?php echo __('Done rearranging/editing charts'); ?>
1566 </a>
1567 </div>
1569 <div class="popupContent settingsPopup">
1570 <a href="#addNewChart">
1571 <?php echo PMA_getImage('b_chart.png'); ?>
1572 <?php echo __('Add chart'); ?>
1573 </a>
1574 <a href="#rearrangeCharts"><?php echo PMA_getImage('b_tblops.png'); ?><?php echo __('Rearrange/edit charts'); ?></a>
1575 <div class="clearfloat paddingtop"></div>
1576 <div class="floatleft">
1577 <?php
1578 echo __('Refresh rate') . '<br />';
1579 refreshList('gridChartRefresh', 5, Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200));
1580 ?><br />
1581 </div>
1582 <div class="floatleft">
1583 <?php echo __('Chart columns'); ?> <br />
1584 <select name="chartColumns">
1585 <option>1</option>
1586 <option>2</option>
1587 <option>3</option>
1588 <option>4</option>
1589 <option>5</option>
1590 <option>6</option>
1591 <option>7</option>
1592 <option>8</option>
1593 <option>9</option>
1594 <option>10</option>
1595 </select>
1596 </div>
1598 <div class="clearfloat paddingtop">
1599 <b><?php echo __('Chart arrangement'); ?></b> <?php echo PMA_showHint(__('The arrangement of the charts is stored to the browsers local storage. You may want to export it if you have a complicated set up.')); ?><br/>
1600 <a href="#importMonitorConfig"><?php echo __('Import'); ?></a>&nbsp;&nbsp;<a href="#exportMonitorConfig"><?php echo __('Export'); ?></a>&nbsp;&nbsp;<a href="#clearMonitorConfig"><?php echo __('Reset to default'); ?></a>
1601 </div>
1602 </div>
1604 <div id="monitorInstructionsDialog" title="<?php echo __('Monitor Instructions'); ?>" style="display:none;">
1605 <?php echo __('The phpMyAdmin Monitor can assist you in optimizing the server configuration and track down time intensive queries. For the latter you will need to set log_output to \'TABLE\' and have either the slow_query_log or general_log enabled. Note however, that the general_log produces a lot of data and increases server load by up to 15%'); ?>
1606 <?php if (PMA_MYSQL_INT_VERSION < 50106) { ?>
1608 <?php echo PMA_getImage('s_attention.png'); ?>
1609 <?php
1610 echo __('Unfortunately your Database server does not support logging to table, which is a requirement for analyzing the database logs with phpMyAdmin. Logging to table is supported by MySQL 5.1.6 and onwards. You may still use the server charting features however.');
1612 </p>
1613 <?php
1614 } else {
1616 <p></p>
1617 <img class="ajaxIcon" src="<?php echo $GLOBALS['pmaThemeImage']; ?>ajax_clock_small.gif" alt="Loading" />
1618 <div class="ajaxContent"></div>
1619 <div class="monitorUse" style="display:none;">
1620 <p></p>
1621 <?php
1622 echo '<strong>';
1623 echo __('Using the monitor:');
1624 echo '</strong><p>';
1625 echo __('Your browser will refresh all displayed charts in a regular interval. You may add charts and change the refresh rate under \'Settings\', or remove any chart using the cog icon on each respective chart.');
1626 echo '</p><p>';
1627 echo __('To display queries from the logs, select the relevant time span on any chart by holding down the left mouse button and panning over the chart. Once confirmed, this will load a table of grouped queries, there you may click on any occuring SELECT statements to further analyze them.');
1628 echo '</p>';
1631 <?php echo PMA_getImage('s_attention.png'); ?>
1632 <?php
1633 echo '<strong>';
1634 echo __('Please note:');
1635 echo '</strong><br />';
1636 echo __('Enabling the general_log may increase the server load by 5-15%. Also be aware that generating statistics from the logs is a load intensive task, so it is advisable to select only a small time span and to disable the general_log and empty its table once monitoring is not required any more.');
1638 </p>
1639 </div>
1640 <?php } ?>
1641 </div>
1643 <div id="addChartDialog" title="<?php echo __('Add chart'); ?>" style="display:none;">
1644 <div id="tabGridVariables">
1645 <p><input type="text" name="chartTitle" value="<?php echo __('Chart Title'); ?>" /></p>
1647 <input type="radio" name="chartType" value="preset" id="chartPreset" />
1648 <label for="chartPreset"><?php echo __('Preset chart'); ?></label>
1649 <select name="presetCharts"></select><br/>
1651 <input type="radio" name="chartType" value="variable" id="chartStatusVar" checked="checked" />
1652 <label for="chartStatusVar"><?php echo __('Status variable(s)'); ?></label><br/>
1653 <div id="chartVariableSettings">
1654 <label for="chartSeries"><?php echo __('Select series:'); ?></label><br />
1655 <select id="chartSeries" name="varChartList" size="1">
1656 <option><?php echo __('Commonly monitored'); ?></option>
1657 <option>Processes</option>
1658 <option>Questions</option>
1659 <option>Connections</option>
1660 <option>Bytes_sent</option>
1661 <option>Bytes_received</option>
1662 <option>Threads_connected</option>
1663 <option>Created_tmp_disk_tables</option>
1664 <option>Handler_read_first</option>
1665 <option>Innodb_buffer_pool_wait_free</option>
1666 <option>Key_reads</option>
1667 <option>Open_tables</option>
1668 <option>Select_full_join</option>
1669 <option>Slow_queries</option>
1670 </select><br />
1671 <label for="variableInput"><?php echo __('or type variable name:'); ?> </label>
1672 <input type="text" name="variableInput" id="variableInput" />
1673 <p></p>
1674 <input type="checkbox" name="differentialValue" id="differentialValue" value="differential" checked="checked" />
1675 <label for="differentialValue"><?php echo __('Display as differential value'); ?></label><br />
1676 <input type="checkbox" id="useDivisor" name="useDivisor" value="1" />
1677 <label for="useDivisor"><?php echo __('Apply a divisor'); ?></label>
1678 <span class="divisorInput" style="display:none;">
1679 <input type="text" name="valueDivisor" size="4" value="1" />
1680 (<a href="#kibDivisor"><?php echo __('KiB'); ?></a>, <a href="#mibDivisor"><?php echo __('MiB'); ?></a>)
1681 </span><br />
1683 <input type="checkbox" id="useUnit" name="useUnit" value="1" />
1684 <label for="useUnit"><?php echo __('Append unit to data values'); ?></label>
1686 <span class="unitInput" style="display:none;">
1687 <input type="text" name="valueUnit" size="4" value="" />
1688 </span>
1690 <a href="#submitAddSeries"><b><?php echo __('Add this series'); ?></b></a>
1691 <span id="clearSeriesLink" style="display:none;">
1692 | <a href="#submitClearSeries"><?php echo __('Clear series'); ?></a>
1693 </span>
1694 </p>
1695 <?php echo __('Series in Chart:'); ?><br/>
1696 <span id="seriesPreview">
1697 <i><?php echo __('None'); ?></i>
1698 </span>
1699 </div>
1700 </div>
1701 </div>
1703 <!-- For generic use -->
1704 <div id="emptyDialog" title="Dialog" style="display:none;">
1705 </div>
1707 <?php if (!PMA_DRIZZLE) { ?>
1708 <div id="logAnalyseDialog" title="<?php echo __('Log statistics'); ?>" style="display:none;">
1709 <p> <?php echo __('Selected time range:'); ?>
1710 <input type="text" name="dateStart" class="datetimefield" value="" /> -
1711 <input type="text" name="dateEnd" class="datetimefield" value="" /></p>
1712 <input type="checkbox" id="limitTypes" value="1" checked="checked" />
1713 <label for="limitTypes">
1714 <?php echo __('Only retrieve SELECT,INSERT,UPDATE and DELETE Statements'); ?>
1715 </label>
1716 <br/>
1717 <input type="checkbox" id="removeVariables" value="1" checked="checked" />
1718 <label for="removeVariables">
1719 <?php echo __('Remove variable data in INSERT statements for better grouping'); ?>
1720 </label>
1722 <?php
1723 echo '<p>';
1724 echo __('Choose from which log you want the statistics to be generated from.');
1725 echo '</p><p>';
1726 echo __('Results are grouped by query text.');
1727 echo '</p>';
1729 </div>
1731 <div id="queryAnalyzerDialog" title="<?php echo __('Query analyzer'); ?>" style="display:none;">
1732 <textarea id="sqlquery"> </textarea>
1733 <p></p>
1734 <div class="placeHolder"></div>
1735 </div>
1736 <?php } ?>
1738 <table border="0" class="clearfloat" id="chartGrid">
1740 </table>
1741 <div id="logTable">
1742 <br/>
1743 </div>
1745 <script type="text/javascript">
1746 variableNames = [ <?php
1747 $i=0;
1748 foreach ($server_status as $name=>$value) {
1749 if (is_numeric($value)) {
1750 if ($i++ > 0) {
1751 echo ", ";
1753 echo "'" . $name . "'";
1756 ?> ];
1757 </script>
1758 <?php
1761 /* Builds a <select> list for refresh rates */
1762 function refreshList($name, $defaultRate=5, $refreshRates=Array(1, 2, 5, 10, 20, 40, 60, 120, 300, 600))
1765 <select name="<?php echo $name; ?>" id="id_<?php echo $name; ?>">
1766 <?php
1767 foreach ($refreshRates as $rate) {
1768 $selected = ($rate == $defaultRate)?' selected="selected"':'';
1770 if ($rate<60) {
1771 echo '<option value="' . $rate . '"' . $selected . '>' . sprintf(_ngettext('%d second', '%d seconds', $rate), $rate) . '</option>';
1772 } else {
1773 echo '<option value="' . $rate . '"' . $selected . '>' . sprintf(_ngettext('%d minute', '%d minutes', $rate/60), $rate/60) . '</option>';
1777 </select>
1778 <?php
1782 * cleanup of some deprecated values
1784 * @param array &$server_status
1786 function cleanDeprecated(&$server_status)
1788 $deprecated = array(
1789 'Com_prepare_sql' => 'Com_stmt_prepare',
1790 'Com_execute_sql' => 'Com_stmt_execute',
1791 'Com_dealloc_sql' => 'Com_stmt_close',
1794 foreach ($deprecated as $old => $new) {
1795 if (isset($server_status[$old]) && isset($server_status[$new])) {
1796 unset($server_status[$old]);
1802 * Sends the footer
1804 require './libraries/footer.inc.php';