Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Recorders/CacheInteractions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 8 additions & 0 deletions tests/Feature/CacheInteractionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down