MemoryHandler
extends AbstractHandler
in package
Debug memory handler class
Tags
Table of Contents
Properties
- $limit : int
- Memory limit
- $name : string|null
- Name of time measurement
- $peaks : array<string|int, mixed>
- Peak memory usage snapshots
- $usages : array<string|int, mixed>
- Memory usage snapshots
Methods
- __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|null
- 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() : MemoryHandler
- Take a memory usage snapshot
- updatePeakMemoryUsage() : MemoryHandler
- Take a peak memory usage snapshot
Properties
$limit
Memory limit
protected
int
$limit
= 0
$name
Name of time measurement
protected
string|null
$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|null $name = null ]) : mixed
Instantiate a memory handler object
Parameters
- $name : string|null = null
formatMemoryToInt()
Format memory amount into integer
public
formatMemoryToInt(int|string $memory[, int $bytes = 1024 ]) : int
Parameters
- $memory : int|string
- $bytes : int = 1024
Return values
intformatMemoryToString()
Format memory amount into readable string
public
formatMemoryToString(int|string $memory[, int $bytes = 1024 ]) : string
Parameters
- $memory : int|string
- $bytes : int = 1024
Return values
stringgetLimit()
Get memory limit
public
getLimit() : int
Return values
intgetName()
Get name
public
getName() : string|null
Return values
string|nullgetPeakUsages()
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
boolhasUsages()
Determine if the handler has memory usages snapshots
public
hasUsages() : bool
Return values
boolprepare()
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
stringprepareHeaderAsString()
Prepare header string
public
prepareHeaderAsString() : string
Return values
stringsetName()
Set name
public
setName(string $name) : AbstractHandler
Parameters
- $name : string
Return values
AbstractHandlerupdateMemoryUsage()
Take a memory usage snapshot
public
updateMemoryUsage([bool $real = false ]) : MemoryHandler
Parameters
- $real : bool = false
Return values
MemoryHandlerupdatePeakMemoryUsage()
Take a peak memory usage snapshot
public
updatePeakMemoryUsage([bool $real = false ]) : MemoryHandler
Parameters
- $real : bool = false