wrong percentage

This commit is contained in:
Marc Delisle
2003-07-17 11:48:48 +00:00
parent 02d6e75891
commit 3e4e7b1fdf
2 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-07-17 Marc Delisle <lem9@users.sourceforge.net>
* server_status.php3: the percentages of Query types did not add up
to 100, because the number of connections is included in the total
number of queries, thanks to jht001 ( Jams H Thompson )
2003-07-17 Alexander M. Turek <rabus@users.sourceforge.net>
* tbl_change.php3, libraries/common.lib.php3: Fixed a MySQL 4.1 bug that
appeared when inserting values into ENUM or SET fields.

View File

@@ -180,12 +180,16 @@ unset($tmp_array);
$useBgcolorOne = TRUE;
$countRows = 0;
while (list($name, $value) = each($queryStats)) {
// 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.
?>
<tr>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">&nbsp;<?php echo htmlspecialchars($name); ?>&nbsp;</td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo number_format($value, 0, $number_decimal_separator, $number_thousands_separator); ?>&nbsp;</td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo number_format(($value * 3600 / $serverStatus['Uptime']), 2, $number_decimal_separator, $number_thousands_separator); ?>&nbsp;</td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo number_format(($value * 100 / $serverStatus['Questions']), 2, $number_decimal_separator, $number_thousands_separator); ?>&nbsp;%&nbsp;</td>
<td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>" align="right">&nbsp;<?php echo number_format(($value * 100 / ($serverStatus['Questions'] - $serverStatus['Connections'])), 2, $number_decimal_separator, $number_thousands_separator); ?>&nbsp;%&nbsp;</td>
</tr>
<?php
$useBgcolorOne = !$useBgcolorOne;