]> git.mxchange.org Git - friendica.git/commitdiff
The worker now tells the process runtime length.
authorMichael <heluecht@pirati.ca>
Thu, 19 Jan 2017 17:06:23 +0000 (17:06 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 19 Jan 2017 17:06:23 +0000 (17:06 +0000)
include/poller.php

index b631d2acd15637dad371c7cb122be456d45e22bf..b0c594db1518304b111b5e3bf9323fe7109f06c5 100644 (file)
@@ -153,6 +153,9 @@ function poller_execute($queue) {
        $funcname = str_replace(".php", "", basename($argv[0]))."_run";
 
        if (function_exists($funcname)) {
+
+               $stamp = (float)microtime(true);
+
                logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." ".$queue["parameter"]);
 
                // For better logging create a new process id for every worker call
@@ -169,7 +172,9 @@ function poller_execute($queue) {
                        sleep($cooldown);
                }
 
-               logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done");
+               $duration = (float)round(microtime(true)-$stamp, 3);
+
+               logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".$duration." seconds.");
 
                q("DELETE FROM `workerqueue` WHERE `id` = %d", intval($queue["id"]));
        } else {