aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-06-22 23:09:21 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-06-22 23:09:21 +0200
commitde04304e94c428afd6dcb9f42b215ebbb6cc14d2 (patch)
treea0e18e6473a437dc6a779c40936077eb0c1efbfb
parentd3b3e9265c23be4f0ad185820e8fb195209c2abc (diff)
parentf850d5fa90584bb73ef1a77fd21f825e1d0794ed (diff)
downloadforums-de04304e94c428afd6dcb9f42b215ebbb6cc14d2.tar
forums-de04304e94c428afd6dcb9f42b215ebbb6cc14d2.tar.gz
forums-de04304e94c428afd6dcb9f42b215ebbb6cc14d2.tar.bz2
forums-de04304e94c428afd6dcb9f42b215ebbb6cc14d2.tar.xz
forums-de04304e94c428afd6dcb9f42b215ebbb6cc14d2.zip
Merge pull request #2591 from rxu/ticket/12704
[ticket/12704] Improve the load time information in the footer when enabled * rxu/ticket/12704: [ticket/12704] Improve the load time information in the footer when enabled
-rw-r--r--phpBB/includes/functions.php4
-rw-r--r--phpBB/phpbb/db/driver/firebird.php8
-rw-r--r--phpBB/phpbb/db/driver/mssql.php8
-rw-r--r--phpBB/phpbb/db/driver/mssql_odbc.php8
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php8
-rw-r--r--phpBB/phpbb/db/driver/mysql.php8
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php8
-rw-r--r--phpBB/phpbb/db/driver/oracle.php8
-rw-r--r--phpBB/phpbb/db/driver/postgres.php8
-rw-r--r--phpBB/phpbb/db/driver/sqlite.php8
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php8
11 files changed, 82 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 3d0a4761f3..32acb0c9ff 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5064,10 +5064,10 @@ function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpb
if (isset($GLOBALS['starttime']))
{
$totaltime = microtime(true) - $GLOBALS['starttime'];
- $debug_info[] = sprintf('Time: %.3fs', $totaltime);
+ $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->sql_time, ($totaltime - $db->sql_time), $totaltime);
}
- $debug_info[] = $db->sql_num_queries() . ' Queries (' . $db->sql_num_queries(true) . ' cached)';
+ $debug_info[] = sprintf('<abbr title="Cached: %d">Queries: %d</abbr>', $db->sql_num_queries(true), $db->sql_num_queries());
$memory_usage = memory_get_peak_usage();
if ($memory_usage)
diff --git a/phpBB/phpbb/db/driver/firebird.php b/phpBB/phpbb/db/driver/firebird.php
index c7b185a577..67d7f12b66 100644
--- a/phpBB/phpbb/db/driver/firebird.php
+++ b/phpBB/phpbb/db/driver/firebird.php
@@ -140,6 +140,10 @@ class firebird extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->last_query_text = $query;
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
@@ -241,6 +245,10 @@ class firebird extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if (!$this->transaction)
{
diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php
index 2e56638617..268463a151 100644
--- a/phpBB/phpbb/db/driver/mssql.php
+++ b/phpBB/phpbb/db/driver/mssql.php
@@ -137,6 +137,10 @@ class mssql extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
@@ -152,6 +156,10 @@ class mssql extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php
index de90d878e7..8e5d4c7a4c 100644
--- a/phpBB/phpbb/db/driver/mssql_odbc.php
+++ b/phpBB/phpbb/db/driver/mssql_odbc.php
@@ -156,6 +156,10 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->last_query_text = $query;
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
@@ -172,6 +176,10 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php
index a7f93c8feb..46a9b3a477 100644
--- a/phpBB/phpbb/db/driver/mssqlnative.php
+++ b/phpBB/phpbb/db/driver/mssqlnative.php
@@ -127,6 +127,10 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->last_query_text = $query;
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
@@ -145,6 +149,10 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php
index 569bd4f10a..e93c7239e8 100644
--- a/phpBB/phpbb/db/driver/mysql.php
+++ b/phpBB/phpbb/db/driver/mysql.php
@@ -166,6 +166,10 @@ class mysql extends \phpbb\db\driver\mysql_base
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
@@ -181,6 +185,10 @@ class mysql extends \phpbb\db\driver\mysql_base
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php
index 520bb65b67..8fc306b2cc 100644
--- a/phpBB/phpbb/db/driver/mysqli.php
+++ b/phpBB/phpbb/db/driver/mysqli.php
@@ -175,6 +175,10 @@ class mysqli extends \phpbb\db\driver\mysql_base
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
@@ -190,6 +194,10 @@ class mysqli extends \phpbb\db\driver\mysql_base
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php
index bfc5373e35..d1a186f1ba 100644
--- a/phpBB/phpbb/db/driver/oracle.php
+++ b/phpBB/phpbb/db/driver/oracle.php
@@ -253,6 +253,10 @@ class oracle extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->last_query_text = $query;
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
@@ -430,6 +434,10 @@ class oracle extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php
index a4aa9497ed..a67cd9f7c2 100644
--- a/phpBB/phpbb/db/driver/postgres.php
+++ b/phpBB/phpbb/db/driver/postgres.php
@@ -179,6 +179,10 @@ class postgres extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->last_query_text = $query;
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
@@ -195,6 +199,10 @@ class postgres extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php
index f4c5e240fc..2112e5ba2f 100644
--- a/phpBB/phpbb/db/driver/sqlite.php
+++ b/phpBB/phpbb/db/driver/sqlite.php
@@ -121,6 +121,10 @@ class sqlite extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result);
@@ -136,6 +140,10 @@ class sqlite extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 2c6bf99497..6511c755a0 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -121,6 +121,10 @@ class sqlite3 extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->curtime = microtime(true);
+ }
$this->last_query_text = $query;
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
@@ -137,6 +141,10 @@ class sqlite3 extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
+ else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ {
+ $this->sql_time += microtime(true) - $this->curtime;
+ }
if ($cache && $cache_ttl)
{