Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace App\Framework\Database\Cache\ValueObjects;
use App\Framework\Core\ValueObjects\Duration;
use App\Framework\Core\ValueObjects\Percentage;
/**
* Individual entity metrics value object
*/
final readonly class EntityMetrics
{
public function __construct(
public int $hits,
public int $misses,
public Percentage $hitRatio,
public int $cacheSize,
public Duration $averageAccessTime
) {
}
public function getTotalAccess(): int
{
return $this->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(),
];
}
}