‪TYPO3CMS  10.4
MemoryUsageProcessor.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
25 {
33  public function ‪processLogRecord(‪LogRecord $logRecord)
34  {
35  $bytes = memory_get_usage($this->‪getRealMemoryUsage());
36  if ($this->formatSize) {
37  $size = GeneralUtility::formatSize($bytes);
38  } else {
39  $size = $bytes;
40  }
41  $logRecord->‪addData([
42  'memoryUsage' => $size
43  ]);
44  return $logRecord;
45  }
46 }
‪TYPO3\CMS\Core\Log\Processor\AbstractMemoryProcessor\getRealMemoryUsage
‪bool getRealMemoryUsage()
Definition: AbstractMemoryProcessor.php:55
‪TYPO3\CMS\Core\Log\Processor\MemoryUsageProcessor
Definition: MemoryUsageProcessor.php:25
‪TYPO3\CMS\Core\Log\Processor
Definition: AbstractMemoryProcessor.php:16
‪TYPO3\CMS\Core\Log\Processor\AbstractMemoryProcessor
Definition: AbstractMemoryProcessor.php:22
‪TYPO3\CMS\Core\Log\LogRecord
Definition: LogRecord.php:22
‪TYPO3\CMS\Core\Log\LogRecord\addData
‪LogRecord addData(array $data)
Definition: LogRecord.php:199
‪TYPO3\CMS\Core\Log\Processor\MemoryUsageProcessor\processLogRecord
‪TYPO3 CMS Core Log LogRecord processLogRecord(LogRecord $logRecord)
Definition: MemoryUsageProcessor.php:33
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46