diff --git a/src/Recorders/CacheInteractions.php b/src/Recorders/CacheInteractions.php index 39c37ef2..6b9f278d 100644 --- a/src/Recorders/CacheInteractions.php +++ b/src/Recorders/CacheInteractions.php @@ -48,7 +48,10 @@ public function record(CacheHit|CacheMissed $event): ?Entry { $now = new CarbonImmutable(); - if (Str::startsWith($event->key, ['illuminate:', 'laravel:pulse:'])) { + if ( + Str::startsWith($event->key, ['illuminate:', 'laravel:pulse:', 'nova.metric.']) || + Str::endsWith($event->key, ':timer') + ) { return null; } diff --git a/tests/Feature/CacheInteractionsTest.php b/tests/Feature/CacheInteractionsTest.php index be298cf5..b282a462 100644 --- a/tests/Feature/CacheInteractionsTest.php +++ b/tests/Feature/CacheInteractionsTest.php @@ -40,6 +40,14 @@ expect($interactions)->toHaveCount(0); }); +it('ignores internal illuminate timer interactions interactions', function () { + Cache::get('foo:timer'); + Pulse::store(app(Ingest::class)); + + $interactions = Pulse::ignore(fn () => DB::table('pulse_cache_interactions')->get()); + expect($interactions)->toHaveCount(0); +}); + it('ignores internal pulse cache interactions', function () { Cache::get('laravel:pulse:foo'); Pulse::store(app(Ingest::class));