\Monolog\ProcessorMemoryUsageProcessor

Injects memory_get_usage in all records

Summary

Methods
Properties
Constants
__construct()
__invoke()
No public properties found
No constants found
formatBytes()
$realUsage
$useFormatting
N/A
No private methods found
No private properties found
N/A

Properties

$realUsage

$realUsage : bool

Type

bool — If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.

$useFormatting

$useFormatting : bool

Type

bool — If true, then format memory size to human readable string (MB, KB, B depending on size)

Methods

__construct()

__construct(bool  $realUsage = true, bool  $useFormatting = true) : mixed

Parameters

bool $realUsage

Set this to true to get the real size of memory allocated from system.

bool $useFormatting

If true, then format memory size to human readable string (MB, KB, B depending on size)

Returns

mixed —

__invoke()

__invoke(array  $record) : array

{@inheritDoc}

Parameters

array $record

Returns

array —

formatBytes()

formatBytes(int  $bytes) : string|int

Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is

Parameters

int $bytes

Returns

string|int —

Formatted string if $this->useFormatting is true, otherwise return $bytes as int