Commit 51044d18 authored by Nigel McNie's avatar Nigel McNie

Some tweaking to the db query counting performance code.

Now no longer counts SET NAMES 'utf8' as a write. This means most pages
show as doing no writes, which is correct. 0 writes showed up as blank
in the footer, so tweaked the code appropriately.
parent c4786f5a
......@@ -261,7 +261,7 @@ function init_performance_info() {
global $PERF;
$PERF = new StdClass;
$PERF->dbqueries = 0;
$PERF->dbreads = $PERF->dbwrites = 0;
$PERF->logwrites = 0;
if (function_exists('microtime')) {
$PERF->starttime = microtime();
......
......@@ -1410,7 +1410,6 @@ function db_format_tsfield($field, $as = null) {
function configure_dbconnection() {
global $db;
increment_perf_db_writes();
$db->Execute("SET NAMES 'utf8'");
if (is_mysql()) {
......
......@@ -1599,14 +1599,8 @@ function get_performance_info() {
$inc = get_included_files();
$info['includecount'] = count($inc);
if (!empty($PERF->dbreads)) {
$info['dbreads'] = $PERF->dbreads;
}
if (!empty($PERF->dbwrites)) {
$info['dbwrites'] = $PERF->dbwrites;
}
$info['dbreads'] = $PERF->dbreads;
$info['dbwrites'] = $PERF->dbwrites;
if (function_exists('posix_times')) {
$ptimes = posix_times();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment