Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
PerformanceShutdownMiddleware | |
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
handleShutdown | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\Core\Mvc\Middleware; |
6 | |
7 | use PeServer\Core\Log\ILogger; |
8 | use PeServer\Core\Mvc\Middleware\IShutdownMiddleware; |
9 | use PeServer\Core\Mvc\Middleware\MiddlewareArgument; |
10 | |
11 | /** |
12 | * 要求から応答までの全体に対する測定処理。 |
13 | */ |
14 | final class PerformanceShutdownMiddleware implements IShutdownMiddleware |
15 | { |
16 | public function __construct( |
17 | private ILogger $logger |
18 | ) { |
19 | } |
20 | |
21 | #region IShutdownMiddleware |
22 | |
23 | public function handleShutdown(MiddlewareArgument $argument): void |
24 | { |
25 | $time = microtime(true) - $argument->stores->special->getServer('REQUEST_TIME_FLOAT', 0.0); |
26 | $this->logger->info('shutdown {0} ms', $time); |
27 | } |
28 | |
29 | #endregion |
30 | } |