From 8a9f4f8e62afe7291f43e9ca05fa0fd5e9f2c8b9 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 14 Dec 2024 20:36:22 -0800 Subject: [PATCH] web: fix ops/sample_table_stats.php (shows details of DB tables) --- html/ops/index.php | 1 + html/ops/sample_table_stats.php | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/html/ops/index.php b/html/ops/index.php index 305b8fc07e6..a4c93ae437c 100644 --- a/html/ops/index.php +++ b/html/ops/index.php @@ -97,6 +97,7 @@
  • Application versions
  • Platforms
  • DB row counts and disk usage +
  • DB table details
  • Tail MySQL logs diff --git a/html/ops/sample_table_stats.php b/html/ops/sample_table_stats.php index 0aa42e68cca..f127bca0f15 100644 --- a/html/ops/sample_table_stats.php +++ b/html/ops/sample_table_stats.php @@ -16,20 +16,21 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +// show detailed info about the tables in project's DB + require_once("../inc/util_ops.inc"); -function showTableStatus($db) { +function showTableStatus() { $size = 0; $out = ""; start_table(); - row1($db, 15); row_array(array("Name", "Engine", "Version", "Row Format", "Rows", "Avg Row Length (KB)", "Data Length (MB)", "Max Data Length (MB)", "Index Length (MB)", "Data free (MB)", "Create Time", "Update Time", "Check Time", "Create Options", "Comment")); - _mysql_select_db($db); + db_init(); $result = _mysql_query("show table status"); while($row = _mysql_fetch_array($result)) { $size += ($row["Data_length"] + $row["Index_length"]); $engine = $row["Engine"]; - if (!$engine) $engine = $row["Type"]; + //if (!$engine) $engine = $row["Type"]; row_array(array( $row["Name"], $engine, @@ -55,11 +56,9 @@ function showTableStatus($db) { } db_init(); -page_head("MySQL Table Stats"); +admin_page_head("MySQL Table Stats"); -// add the databases you want to keep track of here -// -showTableStatus("boinc_alpha"); -showTableStatus("cplan"); +showTableStatus(); +admin_page_tail(); ?>