StopwatchMiddleware
in package
implements
Middleware
FinalYes
Table of Contents
Interfaces
- Middleware
Properties
- $logger : LoggerInterface
- $memory : int
- $stopwatch : Stopwatch
Methods
- __construct() : mixed
- execute() : object
- Executes this middleware class.
- formatMemoryInKilobytes() : string
- formatMemoryInMegabytes() : string
- log() : void
- Dispatches a logging request.
Properties
$logger read-only
private
LoggerInterface
$logger
$memory
private
int
$memory
= 0
amount of memory used
$stopwatch read-only
private
Stopwatch
$stopwatch
Methods
__construct()
public
__construct(Stopwatch $stopwatch, LoggerInterface $logger) : mixed
Parameters
- $stopwatch : Stopwatch
- $logger : LoggerInterface
execute()
Executes this middleware class.
public
execute(Command $command, callable(Command): object $next) : object
Parameters
- $command : Command
- $next : callable(Command): object
Return values
objectformatMemoryInKilobytes()
private
formatMemoryInKilobytes(int $memory) : string
Parameters
- $memory : int
Return values
stringformatMemoryInMegabytes()
private
formatMemoryInMegabytes(int $memory) : string
Parameters
- $memory : int
Return values
stringlog()
Dispatches a logging request.
private
log(string $message[, string $priority = LogLevel::INFO ][, array<string|int, mixed> $parameters = [] ]) : void
Parameters
- $message : string
- $priority : string = LogLevel::INFO
- $parameters : array<string|int, mixed> = []