hits + $this->misses; } public function isPopular(): bool { return $this->getTotalAccess() > 100; // Arbitrary threshold } public function isEfficient(): bool { return $this->hitRatio->isAbove(Percentage::from(60.0)); } public function toArray(): array { return [ 'hits' => $this->hits, 'misses' => $this->misses, 'hit_ratio' => $this->hitRatio->format(), 'cache_size' => $this->cacheSize, 'average_access_time_ms' => $this->averageAccessTime->toMilliseconds(), 'total_access' => $this->getTotalAccess(), 'is_popular' => $this->isPopular(), 'is_efficient' => $this->isEfficient(), ]; } }