Documentation

MemoryHandler extends AbstractHandler
in package

Debug memory handler class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.2.0

Table of Contents

Properties

$actualBytes  : bool
Actual bytes flag
$limit  : int
Memory limit
$logger  : Logger|null
Logger object
$loggingParams  : array<string|int, mixed>
Logging params
$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
getLogger()  : Logger|null
Get logger
getLoggingParams()  : array<string|int, mixed>
Get logging params
getName()  : string|null
Get name
getPeakUsages()  : array<string|int, mixed>
Get peak memory usages snapshots
getUsages()  : array<string|int, mixed>
Get memory usages snapshots
hasLogger()  : bool
Has logger
hasLoggingParams()  : bool
Has logging parameters
hasName()  : bool
Has name
hasPeakUsages()  : bool
Determine if the handler has peak memory usages snapshots
hasUsages()  : bool
Determine if the handler has memory usages snapshots
log()  : void
Trigger handler logging
prepare()  : array<string|int, mixed>
Prepare handler data for storage
prepareAsString()  : string
Prepare handler data as string
prepareHeaderAsString()  : string
Prepare header string
setLogger()  : AbstractHandler
Set logger
setLoggingParams()  : AbstractHandler
Set logger
setName()  : AbstractHandler
Set name
updateMemoryUsage()  : MemoryHandler
Take a memory usage snapshot
updatePeakMemoryUsage()  : MemoryHandler
Take a peak memory usage snapshot
updateUsage()  : MemoryHandler
Take both a memory usage and peak usage snapshot

Properties

$actualBytes

Actual bytes flag

protected bool $actualBytes = false

$loggingParams

Logging params

protected array<string|int, mixed> $loggingParams = []

$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([bool $actualBytes = false ][, string|null $name = null ][, Logger|null $logger = null ][, array<string|int, mixed> $loggingParams = [] ]) : mixed

Instantiate a memory handler object

Parameters
$actualBytes : bool = false
$name : string|null = null
$logger : Logger|null = null
$loggingParams : array<string|int, mixed> = []

formatMemoryToInt()

Format memory amount into integer

public formatMemoryToInt(int|string $memory[, int $bytes = 1024 ]) : int
Parameters
$memory : int|string
$bytes : int = 1024
Return values
int

formatMemoryToString()

Format memory amount into readable string

public formatMemoryToString(int|string $memory[, int $bytes = 1024 ]) : string
Parameters
$memory : int|string
$bytes : int = 1024
Return values
string

getLimit()

Get memory limit

public getLimit() : int
Return values
int

getLoggingParams()

Get logging params

public getLoggingParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getName()

Get name

public getName() : string|null
Return values
string|null

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>

hasLogger()

Has logger

public hasLogger() : bool
Return values
bool

hasLoggingParams()

Has logging parameters

public hasLoggingParams() : bool
Return values
bool

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

        
On this page

Search results