modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

In the manager on the landing page (manager home page) show size of log files #1935

Open wshawn opened 16 years ago

wshawn commented 16 years ago

wshawn created Redmine issue ID 1935

I notice when I backup the mysql databases on many of my development sites the log table can run into the hundreds of megs and this typically will go unnoticed by many of us. I believe some error notification should tell the manager when it gets over a preselected (maybe user selectable) value. I found in phpMyadmins db_structure.php how they test for it: This is incomplete but enough to run to... if (isset($each_table ['TABLE_ROWS'] )) { // MyISAM, ISAM or Heap table: Row count, data size and index size // is accurate. if (preg_match('@^(MyISAM|ISAM|HEAP|MEMORY)$@', $each_table ['ENGINE'] )) { if ($is_show_stats) { $tblsize = doubleval($each_table ['Data_length'] ) + doubleval($each_table ['Index_length'] ); $sum_size += $tblsize; list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); if (isset($each_table ['Data_free'] ) && $each_table ['Data_free'] > 0) { list($formatted_overhead, $overhead_unit) = PMA_formatByteDown($each_table['Data_free'], 3, ($each_table['Data_free'] > 0) ? 1 : 0); $overhead_size += $each_table['Data_free']; } } $sum_entries += $each_table ['TABLE_ROWS'] ; } elseif ($each_table ['ENGINE'] == 'InnoDB') { // InnoDB table: Row count is not accurate but data and index // sizes are. if ($is_show_stats) { $tblsize = $each_table['Data_length'] + $each_table['Index_length']; $sum_size += $tblsize; list($formatted_size, $unit) = PMA_formatByteDown($tblsize, 3, ($tblsize > 0) ? 1 : 0); } //$display_rows = ' - '; $sum_entries += $each_table ['TABLE_ROWS'] ; } elseif (preg_match('@^(MRG_MyISAM|BerkeleyDB)$@', $each_table ['ENGINE'] )) { // Merge or BerkleyDB table: Only row count is accurate. if ($is_show_stats) { $formatted_size = ' - '; $unit = ''; } $sum_entries += $each_table ['TABLE_ROWS'] ; } else { // Unknown table type. if ($is_show_stats) { $formatted_size = 'unknown'; $unit = ''; } }

modxbot commented 14 years ago

tracker_integration submitted:

A Pivotal Tracker story has been created for this Issue: http://www.pivotaltracker.com/story/show/3030145