Skip to content

Commit

Permalink
Merge pull request #5959 from BOINC/dpa_table_stats
Browse files Browse the repository at this point in the history
  • Loading branch information
AenBleidd authored Dec 15, 2024
2 parents 1e3eacf + 8a9f4f8 commit 4db6de6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions html/ops/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<li><a href=\"db_form.php?table=app_version\">Application versions</a></li>
<li><a href=\"db_action.php?table=platform\">Platforms</a></li>
<li><a href=dbinfo.php>DB row counts and disk usage</a>
<li><a href=sample_table_stats.php>DB table details</a>
<li><a href=\"show_log.php?f=mysql*.log&amp;l=-20\">Tail MySQL logs</a>
</ul>
Expand Down
17 changes: 8 additions & 9 deletions html/ops/sample_table_stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.

// 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,
Expand All @@ -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();
?>

0 comments on commit 4db6de6

Please sign in to comment.