\Pop\Debug\HandlerMemoryHandler

Debug memory handler class

Summary

Methods
Properties
Constants
__construct()
setName()
getName()
prepare()
prepareHeaderAsString()
prepareAsString()
getLimit()
updateMemoryUsage()
hasUsages()
getUsages()
updatePeakMemoryUsage()
hasPeakUsages()
getPeakUsages()
formatMemoryToString()
formatMemoryToInt()
No public properties found
No constants found
No protected methods found
$name
$limit
$usages
$peaks
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

Name of time measurement

Type

string

$limit

$limit : integer

Memory limit

Type

integer

$usages

$usages : array

Memory usage snapshots

Type

array

$peaks

$peaks : array

Peak memory usage snapshots

Type

array

Methods

__construct()

__construct(string  $name = null) 

Constructor

Instantiate a memory handler object

Parameters

string $name

getName()

getName() : string

Get name

Returns

string

prepare()

prepare() : array

Prepare handler data for storage

Returns

array

prepareHeaderAsString()

prepareHeaderAsString() : string

Prepare header string

Returns

string

prepareAsString()

prepareAsString() : string

Prepare handler data as string

Returns

string

getLimit()

getLimit() : integer

Get memory limit

Returns

integer

updateMemoryUsage()

updateMemoryUsage(boolean  $real = false) : self

Take a memory usage snapshot

Parameters

boolean $real

Returns

self

hasUsages()

hasUsages() : boolean

Determine if the handler has memory usages snapshots

Returns

boolean

getUsages()

getUsages() : array

Get memory usages snapshots

Returns

array

updatePeakMemoryUsage()

updatePeakMemoryUsage(boolean  $real = false) : self

Take a peak memory usage snapshot

Parameters

boolean $real

Returns

self

hasPeakUsages()

hasPeakUsages() : boolean

Determine if the handler has peak memory usages snapshots

Returns

boolean

getPeakUsages()

getPeakUsages() : array

Get peak memory usages snapshots

Returns

array

formatMemoryToString()

formatMemoryToString(integer  $memory, integer  $bytes = 1024) : string

Format memory amount into readable string

Parameters

integer $memory
integer $bytes

Returns

string

formatMemoryToInt()

formatMemoryToInt(integer  $memory, integer  $bytes = 1024) : integer

Format memory amount into integer

Parameters

integer $memory
integer $bytes

Returns

integer