# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: drupal/modules/system/admin.css --- drupal/modules/system/admin.css Base (1.19) +++ drupal/modules/system/admin.css Locally Modified (Based On 1.19) @@ -86,6 +86,16 @@ background-image: url(../../misc/watchdog-ok.png); } +tr .numeric { + text-align: right; + padding-right: 2em; +} +tr.warning td.numeric { + background: url(../../misc/watchdog-warning.png) no-repeat right center; + font-weight: bold; + color: red; +} + /** * Formatting for theme configuration */ Index: drupal/modules/system/system.admin.inc --- drupal/modules/system/system.admin.inc Base (1.90) +++ drupal/modules/system/system.admin.inc Locally Modified (Based On 1.90) @@ -1819,15 +1819,25 @@ * @return * The output HTML. */ -function _system_sql($data, $keys) { +function _system_sql($data, $keys, $zeros) { $rows = array(); foreach ($keys as $key => $explanation) { if (isset($data[$key])) { - $rows[] = array(check_plain($key), check_plain($data[$key]), $explanation); + $rows[] = array( + 'data' => array( + check_plain($key), + array( + 'data' => check_plain($data[$key]), + 'class' => 'numeric' + ), + $explanation . ((isset($zeros[$key])) ? ' ' . t('Ideally, this should be zero.') : ''), + ), + 'class' => ((isset($zeros[$key]) && ($data[$key] != 0)) ? 'warning' : ''), + ); } } - return theme('table', array(t('Variable'), t('Value'), t('Description')), $rows); + return theme('table', array(t('Variable'), array('data' => t('Value'), 'class' => 'numeric'), t('Description')), $rows); } /** @@ -1842,6 +1852,8 @@ $data[$entry->Variable_name] = $entry->Value; } + $zeros = array('Select_full_join' => TRUE, 'Select_range_check' => TRUE, 'Sort_scan' => TRUE, 'Qcache_lowmem_prunes' => TRUE); + $output = '

' . t('Command counters') . '

'; $output .= _system_sql($data, array( 'Com_select' => t('The number of !sql statements.', array('!sql' => 'SELECT')), @@ -1850,16 +1862,16 @@ 'Com_delete' => t('The number of !sql statements.', array('!sql' => 'DELETE')), 'Com_lock_tables' => t('The number of table locks.'), 'Com_unlock_tables' => t('The number of table unlocks.') - )); + ), $zeros); $output .= '

' . t('Query performance') . '

'; $output .= _system_sql($data, array( - 'Select_full_join' => t('The number of joins without an index; should be zero.'), - 'Select_range_check' => t('The number of joins without keys that check for key usage after each row; should be zero.'), - 'Sort_scan' => t('The number of sorts done without using an index; should be zero.'), + 'Select_full_join' => t('The number of joins without an index.'), + 'Select_range_check' => t('The number of joins without keys that check for key usage after each row.'), + 'Sort_scan' => t('The number of sorts done without using an index.'), 'Table_locks_immediate' => t('The number of times a lock could be acquired immediately.'), 'Table_locks_waited' => t('The number of times the server had to wait for a lock.') - )); + ), $zeros); $output .= '

' . t('Query cache information') . '

'; $output .= '

' . t('The MySQL query cache can improve performance of your site by storing the result of queries. Then, if an identical query is received later, the MySQL server retrieves the result from the query cache rather than parsing and executing the statement again.') . '

'; @@ -1867,8 +1879,8 @@ 'Qcache_queries_in_cache' => t('The number of queries in the query cache.'), 'Qcache_hits' => t('The number of times MySQL found previous results in the cache.'), 'Qcache_inserts' => t('The number of times MySQL added a query to the cache (misses).'), - 'Qcache_lowmem_prunes' => t('The number of times MySQL had to remove queries from the cache because it ran out of memory. Ideally should be zero.') - )); + 'Qcache_lowmem_prunes' => t('The number of times MySQL had to remove queries from the cache because it ran out of memory.') + ), $zeros); return $output; }