📄 server_status.php
字号:
$cfg['MySQLManualBase']; ?>/server-status-variables.html" target="documentation">MySQL - <?php echo $strDocu; ?></a></div><p><?phpecho sprintf($strServerStatusUptime, PMA_timespanFormat($server_status['Uptime']), PMA_localisedDate($start_time)) . "\n";?></p><div id="sectionlinks"><?phpforeach ($sections as $section_name => $section) { if (! empty($section['vars']) && ! empty($section['title'])) { echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . PMA_generate_common_url() . '#' . $section_name . '">' . $section['title'] . '</a>' . "\n"; }}?></div><h3><?php echo $strServerTrafficNotes; ?></h3><table id="serverstatustraffic" class="data"><thead><tr> <th colspan="2"><?php echo $strTraffic . ' ' . PMA_showHint($strStatisticsOverrun); ?></th> <th>ø <?php echo $strPerHour; ?></th></tr></thead><tbody><tr class="odd"> <th class="name"><?php echo $strReceived; ?></th> <td class="value"><?php echo implode(' ', PMA_formatByteDown($server_status['Bytes_received'], 4)); ?></td> <td class="value"><?php echo implode(' ', PMA_formatByteDown( $server_status['Bytes_received'] * $hour_factor, 4)); ?></td></tr><tr class="even"> <th class="name"><?php echo $strSent; ?></th> <td class="value"><?php echo implode(' ', PMA_formatByteDown($server_status['Bytes_sent'], 4)); ?></td> <td class="value"><?php echo implode(' ', PMA_formatByteDown( $server_status['Bytes_sent'] * $hour_factor, 4)); ?></td></tr><tr class="odd"> <th class="name"><?php echo $strTotalUC; ?></th> <td class="value"><?php echo implode(' ', PMA_formatByteDown( $server_status['Bytes_received'] + $server_status['Bytes_sent'], 4) ); ?></td> <td class="value"><?php echo implode(' ', PMA_formatByteDown( ($server_status['Bytes_received'] + $server_status['Bytes_sent']) * $hour_factor, 4) ); ?></td></tr></tbody></table><table id="serverstatusconnections" class="data"><thead><tr> <th colspan="2"><?php echo $strConnections; ?></th> <th>ø <?php echo $strPerHour; ?></th> <th>%</th></tr></thead><tbody><tr class="odd"> <th class="name"><?php echo $strMaxConnects; ?></th> <td class="value"><?php echo PMA_formatNumber($server_status['Max_used_connections'], 0); ?> </td> <td class="value">--- </td> <td class="value">--- </td></tr><tr class="even"> <th class="name"><?php echo $strFailedAttempts; ?></th> <td class="value"><?php echo PMA_formatNumber($server_status['Aborted_connects'], 4, 0); ?></td> <td class="value"><?php echo PMA_formatNumber($server_status['Aborted_connects'] * $hour_factor, 4, 2); ?></td> <td class="value"><?php echo $server_status['Connections'] > 0 ? PMA_formatNumber( $server_status['Aborted_connects'] * 100 / $server_status['Connections'], 0, 2) . '%' : '--- '; ?></td></tr><tr class="odd"> <th class="name"><?php echo $strAbortedClients; ?></th> <td class="value"><?php echo PMA_formatNumber($server_status['Aborted_clients'], 4, 0); ?></td> <td class="value"><?php echo PMA_formatNumber($server_status['Aborted_clients'] * $hour_factor, 4, 2); ?></td> <td class="value"><?php echo $server_status['Connections'] > 0 ? PMA_formatNumber( $server_status['Aborted_clients'] * 100 / $server_status['Connections'], 0, 2) . '%' : '--- '; ?></td></tr><tr class="even"> <th class="name"><?php echo $strTotalUC; ?></th> <td class="value"><?php echo PMA_formatNumber($server_status['Connections'], 4, 0); ?></td> <td class="value"><?php echo PMA_formatNumber($server_status['Connections'] * $hour_factor, 4, 2); ?></td> <td class="value"><?php echo PMA_formatNumber(100, 0, 2); ?>%</td></tr></tbody></table><hr class="clearfloat" /><h3><?php echo sprintf($strQueryStatistics, PMA_formatNumber($server_status['Questions'], 0)); ?></h3><table id="serverstatusqueriessummary" class="data"><thead><tr> <th><?php echo $strTotalUC; ?></th> <th>ø <?php echo $strPerHour; ?></th> <th>ø <?php echo $strPerMinute; ?></th> <th>ø <?php echo $strPerSecond; ?></th></tr></thead><tbody><tr class="odd"> <td class="value"><?php echo PMA_formatNumber($server_status['Questions'], 4, 0); ?></td> <td class="value"><?php echo PMA_formatNumber($server_status['Questions'] * $hour_factor, 3, 2); ?></td> <td class="value"><?php echo PMA_formatNumber( $server_status['Questions'] * 60 / $server_status['Uptime'], 3, 2); ?></td> <td class="value"><?php echo PMA_formatNumber( $server_status['Questions'] / $server_status['Uptime'], 3, 2); ?></td></tr></tbody></table><div id="serverstatusqueriesdetails"><?php// number of tables to split values into$tables = 2;$rows_per_table = (int) ceil(count($sections['com']['vars']) / $tables);$current_table = 0;$odd_row = true;$countRows = 0;$perc_factor = 100 / ($server_status['Questions'] - $server_status['Connections']);foreach ($sections['com']['vars'] as $name => $value) { $current_table++; if ($countRows === 0 || $countRows === $rows_per_table) { $odd_row = true; if ($countRows === $rows_per_table) { echo ' </tbody>' . "\n"; echo ' </table>' . "\n"; }?> <table id="serverstatusqueriesdetails<?php echo $current_table; ?>" class="data"> <col class="namecol" /> <col class="valuecol" span="3" /> <thead> <tr><th colspan="2"><?php echo $strQueryType; ?></th> <th>ø <?php echo $strPerHour; ?></th> <th>%</th> </tr> </thead> <tbody><?php } else { $odd_row = !$odd_row; } $countRows++;// For the percentage column, use Questions - Connections, because// the number of connections is not an item of the Query types// but is included in Questions. Then the total of the percentages is 100. $name = str_replace('Com_', '', $name); $name = str_replace('_', ' ', $name);?> <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>"> <th class="name"><?php echo htmlspecialchars($name); ?></th> <td class="value"><?php echo PMA_formatNumber($value, 4, 0); ?></td> <td class="value"><?php echo PMA_formatNumber($value * $hour_factor, 4, 2); ?></td> <td class="value"><?php echo PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td> </tr><?php}?> </tbody> </table></div><div id="serverstatussection"><?php//Unset used variablesunset( $tables, $rows_per_table, $current_table, $countRows, $perc_factor, $hour_factor, $sections['com'], $server_status['Aborted_clients'], $server_status['Aborted_connects'], $server_status['Max_used_connections'], $server_status['Bytes_received'], $server_status['Bytes_sent'], $server_status['Connections'], $server_status['Questions'], $server_status['Uptime']);foreach ($sections as $section_name => $section) { if (! empty($section['vars'])) {?> <table class="data" id="serverstatussection<?php echo $section_name; ?>"> <caption class="tblHeaders"> <a class="top" href="<?php echo $_SERVER['PHP_SELF'] . '?' . PMA_generate_common_url() . '#serverstatus'; ?>" name="<?php echo $section_name; ?>"><?php echo $strPos1; ?> <?php echo ($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 's_asc.png" width="11" height="9" align="middle" alt="" />' : ''); ?> </a><?phpif (! empty($section['title'])) { echo $section['title'];}?> </caption> <col class="namecol" /> <col class="valuecol" /> <col class="descrcol" /> <thead> <tr> <th><?php echo $strVar; ?></th> <th><?php echo $strValue; ?></th> <th><?php echo $strDescription; ?></th> </tr> </thead><?php if (! empty($links[$section_name])) {?> <tfoot> <tr class="tblFooters"> <th colspan="3" class="tblFooters"><?php foreach ($links[$section_name] as $link_name => $link_url) { echo '<a href="' . $link_url . '">' . $link_name . '</a>' . "\n"; } unset($link_url, $link_name);?> </th> </tr> </tfoot><?php }?> <tbody><?php $odd_row = false; foreach ($section['vars'] as $name => $value) { $odd_row = !$odd_row;?> <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>"> <th class="name"><?php echo htmlspecialchars($name); ?></th> <td class="value"><?php if (isset($alerts[$name])) { if ($value > $alerts[$name]) { echo '<span class="attention">'; } else { echo '<span class="allfine">'; } } if ('%' === substr($name, -1, 1)) { echo PMA_formatNumber($value, 0, 2) . ' %'; } elseif (is_numeric($value) && $value == (int) $value) { echo PMA_formatNumber($value, 4, 0); } elseif (is_numeric($value)) { echo PMA_formatNumber($value, 4, 2); } else { echo htmlspecialchars($value); } if (isset($alerts[$name])) { echo '</span>'; } ?></td> <td class="descr"> <?php if (isset($GLOBALS['strShowStatus' . $name . 'Descr'])) { echo $GLOBALS['strShowStatus' . $name . 'Descr']; } if (isset($links[$name])) { foreach ($links[$name] as $link_name => $link_url) { echo ' <a href="' . $link_url . '">' . $link_name . '</a>' . "\n"; } unset($link_url, $link_name); } ?> </td> </tr><?php } unset($name, $value);?> </tbody> </table><?php }}unset($section_name, $section, $sections, $server_status, $odd_row, $alerts);?></div></div><?php/** * Sends the footer */require_once './libraries/footer.inc.php';?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -