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,62 @@
<?php
declare(strict_types=1);
namespace App\Framework\Discovery\Events;
use App\Framework\Cache\CacheKey;
use App\Framework\Core\ValueObjects\Timestamp;
use App\Framework\Discovery\ValueObjects\CacheLevel;
/**
* Cache miss event
*
* Emitted when a cache lookup fails to find the requested data.
*/
final readonly class CacheMissEvent
{
public function __construct(
public CacheKey $cacheKey,
public string $reason,
public CacheLevel $cacheLevel,
public Timestamp $timestamp
) {
}
/**
* Get miss reason category
*/
public function getReasonCategory(): string
{
return match ($this->reason) {
'not_found' => 'miss',
'expired' => 'expiration',
'evicted' => 'eviction',
'corrupted' => 'corruption',
default => 'unknown'
};
}
/**
* Check if this miss could have been prevented
*/
public function isPreventable(): bool
{
return in_array($this->reason, ['expired', 'evicted']);
}
/**
* Convert to array for serialization
*/
public function toArray(): array
{
return [
'cache_key' => $this->cacheKey->toString(),
'reason' => $this->reason,
'reason_category' => $this->getReasonCategory(),
'cache_level' => $this->cacheLevel->value,
'is_preventable' => $this->isPreventable(),
'timestamp' => $this->timestamp->toFloat(),
];
}
}