Documentation

MemoryProcessor
in package
implements ProcessorInterface

Some methods that are common for all memory processors

Tags
author

Rob Jensen

Interfaces, Classes and Traits

ProcessorInterface
An optional interface to allow labelling Monolog processors.

Table of Contents

$realUsage  : bool
$useFormatting  : bool
__construct()  : 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)

Return values
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 int

Search results