MemoryHandler
extends AbstractHandler
in package
Debug memory handler class
Tags
Table of Contents
- $limit : int
- Memory limit
- $name : string
- Name of time measurement
- $peaks : array<string|int, mixed>
- Peak memory usage snapshots
- $usages : array<string|int, mixed>
- Memory usage snapshots
- __construct() : mixed
- Constructor
- formatMemoryToInt() : int
- Format memory amount into integer
- formatMemoryToString() : string
- Format memory amount into readable string
- getLimit() : int
- Get memory limit
- getName() : string
- Get name
- getPeakUsages() : array<string|int, mixed>
- Get peak memory usages snapshots
- getUsages() : array<string|int, mixed>
- Get memory usages snapshots
- hasPeakUsages() : bool
- Determine if the handler has peak memory usages snapshots
- hasUsages() : bool
- Determine if the handler has memory usages snapshots
- prepare() : array<string|int, mixed>
- Prepare handler data for storage
- prepareAsString() : string
- Prepare handler data as string
- prepareHeaderAsString() : string
- Prepare header string
- setName() : AbstractHandler
- Set name
- updateMemoryUsage() : self
- Take a memory usage snapshot
- updatePeakMemoryUsage() : self
- Take a peak memory usage snapshot
Properties
$limit
Memory limit
protected
int
$limit
= 0
$name
Name of time measurement
protected
string
$name
= null
$peaks
Peak memory usage snapshots
protected
array<string|int, mixed>
$peaks
= []
$usages
Memory usage snapshots
protected
array<string|int, mixed>
$usages
= []
Methods
__construct()
Constructor
public
__construct([string $name = null ]) : mixed
Instantiate a memory handler object
Parameters
- $name : string = null
Return values
mixed —formatMemoryToInt()
Format memory amount into integer
public
formatMemoryToInt(int $memory[, int $bytes = 1024 ]) : int
Parameters
- $memory : int
- $bytes : int = 1024
Return values
int —formatMemoryToString()
Format memory amount into readable string
public
formatMemoryToString(int $memory[, int $bytes = 1024 ]) : string
Parameters
- $memory : int
- $bytes : int = 1024
Return values
string —getLimit()
Get memory limit
public
getLimit() : int
Return values
int —getName()
Get name
public
getName() : string
Return values
string —getPeakUsages()
Get peak memory usages snapshots
public
getPeakUsages() : array<string|int, mixed>
Return values
array<string|int, mixed> —getUsages()
Get memory usages snapshots
public
getUsages() : array<string|int, mixed>
Return values
array<string|int, mixed> —hasPeakUsages()
Determine if the handler has peak memory usages snapshots
public
hasPeakUsages() : bool
Return values
bool —hasUsages()
Determine if the handler has memory usages snapshots
public
hasUsages() : bool
Return values
bool —prepare()
Prepare handler data for storage
public
prepare() : array<string|int, mixed>
Return values
array<string|int, mixed> —prepareAsString()
Prepare handler data as string
public
prepareAsString() : string
Return values
string —prepareHeaderAsString()
Prepare header string
public
prepareHeaderAsString() : string
Return values
string —setName()
Set name
public
setName(string $name) : AbstractHandler
Parameters
- $name : string
Return values
AbstractHandler —updateMemoryUsage()
Take a memory usage snapshot
public
updateMemoryUsage([bool $real = false ]) : self
Parameters
- $real : bool = false
Return values
self —updatePeakMemoryUsage()
Take a peak memory usage snapshot
public
updatePeakMemoryUsage([bool $real = false ]) : self
Parameters
- $real : bool = false