chore: complete update
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Framework\CommandBus\Middleware;
|
||||
|
||||
use App\Framework\CommandBus\Middleware;
|
||||
use App\Framework\Performance\PerformanceCategory;
|
||||
use App\Framework\Performance\PerformanceMeter;
|
||||
|
||||
final readonly class PerformanceMonitoringMiddleware implements Middleware
|
||||
{
|
||||
public function __construct(
|
||||
private PerformanceMeter $meter
|
||||
) {}
|
||||
|
||||
public function handle(object $command, callable $next): mixed
|
||||
{
|
||||
$this->meter->startMeasure($command::class, PerformanceCategory::SYSTEM);
|
||||
|
||||
$result = $next($command);
|
||||
|
||||
$this->meter->endMeasure($command::class);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user