Monitoring
in package
Class for monitoring performance.
Table of Contents
Constants
- EveryTimer = 0
- FullStackOnly = 1
- Never = 2
Properties
- $_aditionalData : mixed
- $_logger : Logger
- $_logging : mixed
- $_loglevel : int
- $_timers : array<string|int, mixed>
Methods
- __construct() : void
- Constructor
- __destruct() : void
- Destructor
- EndTimer() : void
- Ends a timer
- Log() : void
- Logs performance data
- StartTimer() : void
- Starts a timer
- _collectAditionalData() : mixed
- Collects additional data
- _message() : string
- Generates a log message
Constants
EveryTimer
public
mixed
EveryTimer
= 0
FullStackOnly
public
mixed
FullStackOnly
= 1
Never
public
mixed
Never
= 2
Properties
$_aditionalData
private
mixed
$_aditionalData
Additional data
$_logger
private
Logger
$_logger
Logger instance
$_logging
private
mixed
$_logging
Frequency of logging
$_loglevel
private
int
$_loglevel
Log level
$_timers
private
array<string|int, mixed>
$_timers
Holds timers data
Methods
__construct()
Constructor
public
__construct(Logger $logger[, int $logLevel = Logger::Debug ][, mixed $logging = self::EveryTimer ]) : void
Parameters
- $logger : Logger
-
The logger instance
- $logLevel : int = Logger::Debug
-
The log level
- $logging : mixed = self::EveryTimer
-
The logging frequency
__destruct()
Destructor
public
__destruct() : void
EndTimer()
Ends a timer
public
EndTimer(string $name[, Closure|null $if = null ]) : void
Parameters
- $name : string
-
The name of the timer
- $if : Closure|null = null
Log()
Logs performance data
public
Log(int $logLevel[, string|null $name = null ]) : void
Parameters
- $logLevel : int
-
The log level
- $name : string|null = null
-
The name of the timer
StartTimer()
Starts a timer
public
StartTimer(string $name) : void
Parameters
- $name : string
-
The name of the timer
_collectAditionalData()
Collects additional data
private
_collectAditionalData() : mixed
_message()
Generates a log message
private
_message(string $name, mixed $timer) : string
Parameters
- $name : string
-
The name of the timer
- $timer : mixed
-
The timer data
Return values
string —The log message