db_stats: now also show server totals

This commit is contained in:
Olivier Müller
2001-08-20 20:53:41 +00:00
parent 78efb0b088
commit b8487c9593
2 changed files with 20 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ $Source$
2001-08-20 Olivier M<>ller <om@omnis.ch> 2001-08-20 Olivier M<>ller <om@omnis.ch>
* db_stats.php3: new file and feature (sorry :) : simply display * db_stats.php3: new file and feature (sorry :) : simply display
an overview of all databases with their respective size. an overview of all databases with their respective size + server total.
* lang/*: new string $strDatabasesStats * lang/*: new string $strDatabasesStats
2001-08-20 Marc Delisle <lem9@users.sourceforge.net> 2001-08-20 Marc Delisle <lem9@users.sourceforge.net>
@@ -53,7 +53,7 @@ $Source$
* main.php3; db_details.php3; tbl_properties.php3; db_readdump.php3; * main.php3; db_details.php3; tbl_properties.php3; db_readdump.php3;
lib.inc.php3: once a query has been executed phpMyAdmin now moves back lib.inc.php3: once a query has been executed phpMyAdmin now moves back
to the calling script (rather than db_details.php3 everytime) as soon as to the calling script (rather than db_details.php3 everytime) as soon as
the current database/table exists, else it moves back to a "parent" the current database/table exists, else it moves back to a "parent"
script (the welcome page/'db_details.php3' if the current script (the welcome page/'db_details.php3' if the current
database/table has has been dropped. database/table has has been dropped.
* header.inc.php3, lines 63-64; sql.php3; db_details.php3; * header.inc.php3, lines 63-64; sql.php3; db_details.php3;
@@ -61,7 +61,7 @@ $Source$
to the calling script (and not the target one used only if this statement to the calling script (and not the target one used only if this statement
is executed). is executed).
* db_readdump.php3: improved Olivier's improvement for mutiple queries (see * db_readdump.php3: improved Olivier's improvement for mutiple queries (see
before). before).
* lib.inc.php3, line 524: beautify a bit the way the query is displayed. * lib.inc.php3, line 524: beautify a bit the way the query is displayed.
* lang/english.inc.php3; lang/french.inc.php3: put $strInstructions at its * lang/english.inc.php3; lang/french.inc.php3: put $strInstructions at its
right place. right place.

View File

@@ -98,6 +98,9 @@ header('Content-Type: text/html; charset=' . $charset);
<?php <?php
if ($num_dbs > 1) { if ($num_dbs > 1) {
$selected_db = 0; $selected_db = 0;
$big_tot_all = 0;
$big_tot_idx = 0;
$big_tot_data = 0;
// Gets the tables list per database // Gets the tables list per database
for ($i = 0; $i < $num_dbs; $i++) { for ($i = 0; $i < $num_dbs; $i++) {
@@ -125,6 +128,9 @@ if ($num_dbs > 1) {
$tot_idx += $row['Index_length']; $tot_idx += $row['Index_length'];
} }
$tot_all = $tot_data + $tot_idx; $tot_all = $tot_data + $tot_idx;
$big_tot_all += $tot_all;
$big_tot_idx += $tot_idx;
$big_tot_data += $tot_data;
} }
list($tot_data_format,$unit_data) = format_byte_down($tot_data,3,1); list($tot_data_format,$unit_data) = format_byte_down($tot_data,3,1);
@@ -139,6 +145,17 @@ if ($num_dbs > 1) {
} }
list($tot_data_format,$unit_data) = format_byte_down($big_tot_data,3,1);
list($tot_idx_format,$unit_idx) = format_byte_down($big_tot_idx,3,1);
list($tot_all_format,$unit_all) = format_byte_down($big_tot_all,3,1);
echo "<tr><th>" . $strSum . " </th>";
echo "<th>$tot_data_format $unit_data </th>";
echo "<th>$tot_idx_format $unit_idx </th>";
echo "<th><b>$tot_all_format $unit_all<b> </th>";
echo "</tr>";
echo "</table>"; echo "</table>";
} // end if ($num_dbs == 1) } // end if ($num_dbs == 1)