Memory
in package
Tracks Memory and time usage, mainly for cron jobs.
Table of Contents
Properties
- $_defaultConfig : array<string, mixed>
- Default config settings.
- $_endTimes : array<string, int>
- Trackes the end times.
- $_startTimes : array<string, int>
- Trackes the start times.
- $memUsageHighest : float
- Tracks the highest recorded memory usage from when memoryUsage was called.
Methods
- usage() : string
- Reports the memory usage at the time it is called.
- usageHighest() : string
- Reports the highest memory usage.
Properties
$_defaultConfig
Default config settings.
protected
array<string, mixed>
$_defaultConfig
= []
$_endTimes
Trackes the end times.
protected
array<string, int>
$_endTimes
= []
Format is ['(time_key)' => (unix timestamp)].
$_startTimes
Trackes the start times.
protected
array<string, int>
$_startTimes
= []
Format is ['(time_key)' => (unix timestamp)].
$memUsageHighest
Tracks the highest recorded memory usage from when memoryUsage was called.
protected
float
$memUsageHighest
= 0
Methods
usage()
Reports the memory usage at the time it is called.
public
usage([bool $nice = true ][, float|null $mem_usage = null ]) : string
Parameters
- $nice : bool = true
-
If we should return the bytes (false), of the calculated amount in a nice format (true).
- $mem_usage : float|null = null
-
The memory number to be made nice.
Return values
string —the memory usage stat.
usageHighest()
Reports the highest memory usage.
public
usageHighest([bool $nice = true ]) : string
Parameters
- $nice : bool = true
-
If we should return the bytes (false), of the calculated amount in a nice format (true).
Return values
string —the highest memory usage stat.