MemoryUsageProcessor
        
        extends MemoryProcessor
    
    
            
            in package
            
        
    
    
    
Injects memory_get_usage in all records
Tags
Table of Contents
Properties
- $realUsage : bool
- $useFormatting : bool
Methods
- __construct() : mixed
- __invoke() : array<string|int, mixed>
- formatBytes() : string|int
- Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
Properties
$realUsage
    protected
        bool
    $realUsage
    
    
        If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
$useFormatting
    protected
        bool
    $useFormatting
    
    
        If true, then format memory size to human readable string (MB, KB, B depending on size)
Methods
__construct()
    public
                    __construct([bool $realUsage = true ][, bool $useFormatting = true ]) : mixed
    Parameters
- $realUsage : bool = true
- 
                    Set this to true to get the real size of memory allocated from system. 
- $useFormatting : bool = true
- 
                    If true, then format memory size to human readable string (MB, KB, B depending on size) 
__invoke()
    public
                    __invoke(array<string|int, mixed> $record) : array<string|int, mixed>
    Parameters
- $record : array<string|int, mixed>
Return values
array<string|int, mixed>formatBytes()
Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
    protected
                    formatBytes(int $bytes) : string|int
    Parameters
- $bytes : int
Return values
string|int —Formatted string if $this->useFormatting is true, otherwise return $bytes as is