X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FProfiler.php;h=24289678c266a41450b751fff3b6132ff8355cd7;hb=8039ab731fe0045088a9834cdc1fa6a44b9719aa;hp=82f67b0c0583bd833deb071a840e4f253375d21e;hpb=c89533a70b42a4702d5b69cf65c370d428ad71b6;p=friendica.git diff --git a/src/Util/Profiler.php b/src/Util/Profiler.php index 82f67b0c05..24289678c2 100644 --- a/src/Util/Profiler.php +++ b/src/Util/Profiler.php @@ -1,6 +1,6 @@ enabled = $config->get('system', 'profiler'); $this->rendertime = $config->get('rendertime', 'callstack'); } /** - * @param Cache $configCache The configuration cache + * @param \Friendica\Core\Config\ValueObject\Cache $configCache The configuration cache */ public function __construct(Cache $configCache) { @@ -87,6 +87,12 @@ class Profiler implements ContainerInterface $this->reset(); } + /** + * Start a profiler recording + * + * @param string $value + * @return void + */ public function startRecording(string $value) { if (!$this->enabled) { @@ -96,6 +102,12 @@ class Profiler implements ContainerInterface $this->timestamps[] = ['value' => $value, 'stamp' => microtime(true), 'credit' => 0]; } + /** + * Stop a profiler recording + * + * @param string $callstack + * @return void + */ public function stopRecording(string $callstack = '') { if (!$this->enabled || empty($this->timestamps)) { @@ -114,7 +126,6 @@ class Profiler implements ContainerInterface $callstack = $callstack ?: System::callstack(4, $value == 'rendering' ? 0 : 1); if (!isset($this->performance[$value])) { - // Prevent ugly E_NOTICE $this->performance[$value] = 0; } @@ -187,7 +198,7 @@ class Profiler implements ContainerInterface $this->performance['network'] = 0; $this->performance['file'] = 0; $this->performance['rendering'] = 0; - $this->performance['parser'] = 0; + $this->performance['session'] = 0; $this->performance['marktime'] = 0; $this->performance['marktime'] = microtime(true); $this->performance['classcreate'] = 0; @@ -209,7 +220,7 @@ class Profiler implements ContainerInterface $this->callstack['network'] = []; $this->callstack['file'] = []; $this->callstack['rendering'] = []; - $this->callstack['parser'] = []; + $this->callstack['session'] = []; } /** @@ -271,6 +282,7 @@ class Profiler implements ContainerInterface } } } + if (isset($this->callstack["rendering"])) { $output .= "\nRendering:\n"; foreach ($this->callstack["rendering"] as $func => $time) {