From 69f1deb16674f9d40ed8245cc5774aa5f234b80f Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 21 Jan 2017 20:15:49 +0000 Subject: [PATCH] Some added logging --- include/dba.php | 5 +++++ include/poller.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/dba.php b/include/dba.php index 7d2d3bbd0f..8e2d18db60 100644 --- a/include/dba.php +++ b/include/dba.php @@ -138,6 +138,11 @@ class dba { return $return; } + /** + * @brief Analyze a database query and log this if some conditions are met. + * + * @param string $query The database query that will be analyzed + */ public function log_index($query) { $a = get_app(); diff --git a/include/poller.php b/include/poller.php index c0b92bb811..10bc70aae3 100644 --- a/include/poller.php +++ b/include/poller.php @@ -179,6 +179,8 @@ function poller_exec_function($queue, $funcname, $argv) { $stamp = (float)microtime(true); + // We use the callstack here to analyze the performance of executed worker entries. + // For this reason the variables have to be initialized. if (Config::get("system", "profiler")) { $a->performance["start"] = microtime(true); $a->performance["database"] = 0; @@ -205,6 +207,7 @@ function poller_exec_function($queue, $funcname, $argv) { logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".$duration." seconds."); + // Write down the performance values into the log if (Config::get("system", "profiler")) { $duration = microtime(true)-$a->performance["start"];