PHP Class DebugKit\DebugMemory

Datei anzeigen Open project: cakephp/debug_kit Class Usage Examples

Protected Properties

Property Type Description
$_points array An array of recorded memory use points.

Public Methods

Method Description
clear ( ) : void Clear out any existing memory points
getAll ( boolean $clear = false ) : array Get all the stored memory points
getCurrent ( ) : integer Get current memory usage
getPeak ( ) : integer Get peak memory use
record ( string $message = null ) : boolean Stores a memory point in the internal tracker.

Method Details

clear() public static method

Clear out any existing memory points
public static clear ( ) : void
return void

getAll() public static method

Get all the stored memory points
public static getAll ( boolean $clear = false ) : array
$clear boolean Whether you want to clear the memory points as well. Defaults to false.
return array Array of memory marks stored so far.

getCurrent() public static method

Get current memory usage
public static getCurrent ( ) : integer
return integer number of bytes ram currently in use. 0 if memory_get_usage() is not available.

getPeak() public static method

Get peak memory use
public static getPeak ( ) : integer
return integer peak memory use (in bytes). Returns 0 if memory_get_peak_usage() is not available

record() public static method

Takes a optional message name which can be used to identify the memory point. If no message is supplied a debug_backtrace will be done to identify the memory point.
public static record ( string $message = null ) : boolean
$message string Message to identify this memory point.
return boolean

Property Details

$_points protected_oe static_oe property

An array of recorded memory use points.
protected static array $_points
return array