4 * This file is part of the Monolog package.
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Monolog\Processor;
15 * Injects memory_get_peak_usage in all records
17 * @see Monolog\Processor\MemoryProcessor::__construct() for options
20 class MemoryPeakUsageProcessor extends MemoryProcessor
23 * @param array $record
26 public function __invoke(array $record)
28 $bytes = memory_get_peak_usage($this->realUsage);
29 $formatted = $this->formatBytes($bytes);
31 $record['extra']['memory_peak_usage'] = $formatted;