container->has(PerformanceCollectorInterface::class)) { return $next($command); } $collector = $this->container->get(PerformanceCollectorInterface::class); // Prüfe ob Performance Tracking aktiviert ist if (!$collector->isEnabled()) { return $next($command); } $commandKey = 'command_' . basename(str_replace('\\', '/', $command::class)); $collector->startTiming($commandKey, PerformanceCategory::SYSTEM, [ 'command_class' => $command::class, ]); try { $result = $next($command); $collector->endTiming($commandKey); return $result; } catch (\Throwable $e) { $collector->endTiming($commandKey); throw $e; } } }