- if ($this->enabled) {
- $duration = microtime(true)-$this->get('start');
- $this->logger->info(
- $message,
- [
- 'module' => 'api',
- 'action' => 'call',
- 'database_read' => round($this->get('database') - $this->get('database_write'), 3),
- 'database_write' => round($this->get('database_write'), 3),
- 'cache_read' => round($this->get('cache'), 3),
- 'cache_write' => round($this->get('cache_write'), 3),
- 'network_io' => round($this->get('network'), 2),
- 'file_io' => round($this->get('file'), 2),
- 'other_io' => round($duration - ($this->get('database')
- + $this->get('cache') + $this->get('cache_write')
- + $this->get('network') + $this->get('file')), 2),
- 'total' => round($duration, 2)
- ]
- );
-
- $o = '';
- if ($this->rendertime) {
- if (isset($this->callstack["database"])) {
- $o .= "\nDatabase Read:\n";
- foreach ($this->callstack["database"] as $func => $time) {
- $time = round($time, 3);
- if ($time > 0) {
- $o .= $func.": ".$time."\n";
- }
- }
+ if (!$this->enabled) {
+ return;
+ }
+ $duration = microtime(true) - $this->get('start');
+ $logger->info(
+ $message,
+ [
+ 'action' => 'profiling',
+ 'database_read' => round($this->get('database') - $this->get('database_write'), 3),
+ 'database_write' => round($this->get('database_write'), 3),
+ 'cache_read' => round($this->get('cache'), 3),
+ 'cache_write' => round($this->get('cache_write'), 3),
+ 'network_io' => round($this->get('network'), 2),
+ 'file_io' => round($this->get('file'), 2),
+ 'other_io' => round($duration - ($this->get('database')
+ + $this->get('cache') + $this->get('cache_write')
+ + $this->get('network') + $this->get('file')), 2),
+ 'total' => round($duration, 2)
+ ]
+ );
+
+ if (!$this->rendertime) {
+ return;
+ }
+
+ $o = '';
+ if (isset($this->callstack["database"])) {
+ $o .= "\nDatabase Read:\n";
+ foreach ($this->callstack["database"] as $func => $time) {
+ $time = round($time, 3);
+ if ($time > 0) {
+ $o .= $func . ": " . $time . "\n";