Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimivar <simivar@gmail.com>2019-04-11 05:54:44 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-04-11 05:54:44 +0300
commit1d9bcc8ce70c551fbc7d764b81f32c9462e84988 (patch)
treebf680df07a2cafdaa39d359deeea5a6c74ad04d5
parent12416e0e60d0792d5d84c688b64a6aab16f26c91 (diff)
Add enable_sql_profiler setting to Tracker (#14288)
* Add enable_sql_profiler setting to Tracker * Adjust message @simivar fyi removed the need for `[log]` as it should be 99% enabled. It's just important they also enable tracker debug.
-rwxr-xr-xconfig/global.ini.php5
-rw-r--r--core/Tracker/Response.php2
2 files changed, 6 insertions, 1 deletions
diff --git a/config/global.ini.php b/config/global.ini.php
index c8cfe7b6af..fbd01ea1d9 100755
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -827,6 +827,11 @@ tracking_requests_require_authentication = 1
; You can change how far back Matomo will track your requests without authentication. The configured value is in seconds.
tracking_requests_require_authentication_when_custom_timestamp_newer_than = 86400;
+; if set to 1, all the SQL queries will be recorded by the profiler
+; and a profiling summary will be printed at the end of the request
+; NOTE: you must also set "[Tracker] debug = 1" to enable the profiler.
+enable_sql_profiler = 0
+
[Segments]
; Reports with segmentation in API requests are processed in real time.
; On high traffic websites it is recommended to pre-process the data
diff --git a/core/Tracker/Response.php b/core/Tracker/Response.php
index 7d58e8cd69..3fa2aa74d1 100644
--- a/core/Tracker/Response.php
+++ b/core/Tracker/Response.php
@@ -25,7 +25,7 @@ class Response
{
ob_start(); // we use ob_start only because of Common::printDebug, we should actually not really use ob_start
- if ($tracker->isDebugModeEnabled()) {
+ if ($tracker->isDebugModeEnabled() && TrackerConfig::getConfigValue('enable_sql_profiler')) {
$this->timer = new Timer();
TrackerDb::enableProfiling();