Documentation

MemoryProcessor
in package
implements ProcessorInterface

AbstractYes

Some methods that are common for all memory processors

Tags
author

Rob Jensen

Table of Contents

Interfaces

ProcessorInterface
An optional interface to allow labelling Monolog processors.

Properties

$realUsage  : bool
$useFormatting  : bool

Methods

__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)

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


        
On this page

Search results