MemoryUsageProcessor extends AbstractMemoryProcessor

Memory usage processor methods.

Table of Contents

Properties

$formatSize  : bool
Whether the size is formatted, e.g. in megabytes
$realMemoryUsage  : bool
Allocated memory usage type to use If set, the real size of memory allocated from system is used.

Methods

__construct()  : mixed
Constructs this log processor
getFormatSize()  : bool
Returns whether size should be formatted
getRealMemoryUsage()  : bool
Returns the allocated memory usage type
processLogRecord()  : LogRecord
Processes a log record and adds memory usage information.
setFormatSize()  : mixed
Sets whether size should be formatted
setRealMemoryUsage()  : mixed
Sets the allocated memory usage type

Properties

$realMemoryUsage

Allocated memory usage type to use If set, the real size of memory allocated from system is used.

protected bool $realMemoryUsage = true

Otherwise the memory used by emalloc() is used.

Tags
see
memory_get_usage()
see
memory_get_peak_usage()

Methods

__construct()

Constructs this log processor

public __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

Configuration options - depends on the actual processor

Tags
throws
InvalidLogProcessorConfigurationException

getFormatSize()

Returns whether size should be formatted

public getFormatSize() : bool
Return values
bool

getRealMemoryUsage()

Returns the allocated memory usage type

public getRealMemoryUsage() : bool
Return values
bool

processLogRecord()

Processes a log record and adds memory usage information.

public processLogRecord(LogRecord $logRecord) : LogRecord
Parameters
$logRecord : LogRecord

The log record to process

Tags
see
memory_get_usage()
Return values
LogRecord

The processed log record with additional data

setFormatSize()

Sets whether size should be formatted

public setFormatSize(bool $formatSize) : mixed
Parameters
$formatSize : bool

setRealMemoryUsage()

Sets the allocated memory usage type

public setRealMemoryUsage(bool $realMemoryUsage) : mixed
Parameters
$realMemoryUsage : bool

Which allocated memory type to use


        
On this page

Search results