From ef0ea05a8f97ef0f87990e6a78a9781be0848efa Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Thu, 30 Mar 2023 00:41:16 +0100 Subject: [PATCH] Measure time only for user queries Signed-off-by: Kamil Tekiela --- libraries/classes/DatabaseInterface.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index 6a420263a7..54d033288a 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -218,11 +218,14 @@ class DatabaseInterface implements DbalInterface $result = $this->extension->realQuery($query, $this->links[$link], $options); + if ($link === self::CONNECT_USER) { + $this->lastQueryExecutionTime = microtime(true) - $time; + } + if ($cache_affected_rows) { $GLOBALS['cached_affected_rows'] = $this->affectedRows($link, false); } - $this->lastQueryExecutionTime = microtime(true) - $time; if ($debug) { $errorMessage = $this->getError($link); Utilities::debugLogQueryIntoSession(