mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
Merge pull request #1284 from TheDigitalOrchard/master
optimize MemoryUsage processors
This commit is contained in:
@@ -21,10 +21,13 @@ class MemoryPeakUsageProcessor extends MemoryProcessor
|
|||||||
{
|
{
|
||||||
public function __invoke(array $record): array
|
public function __invoke(array $record): array
|
||||||
{
|
{
|
||||||
$bytes = memory_get_peak_usage($this->realUsage);
|
$usage = memory_get_peak_usage($this->realUsage);
|
||||||
$formatted = $this->formatBytes($bytes);
|
|
||||||
|
|
||||||
$record['extra']['memory_peak_usage'] = $formatted;
|
if ($this->useFormatting) {
|
||||||
|
$usage = $this->formatBytes($usage);
|
||||||
|
}
|
||||||
|
|
||||||
|
$record['extra']['memory_peak_usage'] = $usage;
|
||||||
|
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
@@ -21,10 +21,13 @@ class MemoryUsageProcessor extends MemoryProcessor
|
|||||||
{
|
{
|
||||||
public function __invoke(array $record): array
|
public function __invoke(array $record): array
|
||||||
{
|
{
|
||||||
$bytes = memory_get_usage($this->realUsage);
|
$usage = memory_get_usage($this->realUsage);
|
||||||
$formatted = $this->formatBytes($bytes);
|
|
||||||
|
|
||||||
$record['extra']['memory_usage'] = $formatted;
|
if ($this->useFormatting) {
|
||||||
|
$usage = $this->formatBytes($usage);
|
||||||
|
}
|
||||||
|
|
||||||
|
$record['extra']['memory_usage'] = $usage;
|
||||||
|
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user