itemsFailed === 0; } public function getSuccessRate(): float { $total = $this->itemsWarmed + $this->itemsFailed; if ($total === 0) { return 0.0; } return $this->itemsWarmed / $total; } public function getItemsPerSecond(): float { if ($this->durationSeconds === 0.0) { return 0.0; } return $this->itemsWarmed / $this->durationSeconds; } public function getMemoryUsedMB(): float { return $this->memoryUsedBytes / 1024 / 1024; } public function toArray(): array { return [ 'strategy_name' => $this->strategyName, 'items_warmed' => $this->itemsWarmed, 'items_failed' => $this->itemsFailed, 'duration_seconds' => $this->durationSeconds, 'memory_used_bytes' => $this->memoryUsedBytes, 'memory_used_mb' => round($this->getMemoryUsedMB(), 2), 'success_rate' => round($this->getSuccessRate() * 100, 2), 'items_per_second' => round($this->getItemsPerSecond(), 2), 'is_success' => $this->isSuccess(), 'errors' => $this->errors, 'metadata' => $this->metadata ]; } }