diff --git a/src/Override/DefaultOverride.php b/src/Override/DefaultOverride.php index 35e2254..8b504b2 100644 --- a/src/Override/DefaultOverride.php +++ b/src/Override/DefaultOverride.php @@ -5,6 +5,7 @@ use Illuminate\Contracts\Queue\Job; use Illuminate\Http\Request; use Illuminate\Notifications\Notification; +use Illuminate\Support\Str; use Jaybizzle\CrawlerDetect\CrawlerDetect; use Symfony\Component\Mime\Email; @@ -16,7 +17,13 @@ class DefaultOverride implements LaritorOverride */ public function recordCacheHit($cacheKey): bool { - return true; + $ignore = [ + 'illuminate:queue', + 'laravel:', + 'telescope:' + ]; + + return ! Str::startsWith($cacheKey, $ignore); } /** @@ -58,7 +65,19 @@ public function recordOutboundRequest($url): bool */ public function recordQuery($query, $duration): bool { - return true; + $ignore = [ + "`".config('session.table')."`", + "`".config('cache.stores.database.table')."`", + "`".config('queue.connections.database.table')."`", + "`".config('pennant.stores.database.table')."`", + "`telescope_entries`", + "`telescope_entries_tags`", + "`pulse_entries`", + "`pulse_aggregates`", + "`action_events`", + ]; + + return ! Str::contains($query, $ignore); } /** diff --git a/src/Recorders/CacheRecorder.php b/src/Recorders/CacheRecorder.php index fe0e656..86018a0 100644 --- a/src/Recorders/CacheRecorder.php +++ b/src/Recorders/CacheRecorder.php @@ -32,7 +32,7 @@ class CacheRecorder extends Recorder */ public function trackEvent($event) { - if ( Str::startsWith($event->key, ['laritor','illuminate:queue:restart']) || + if ( Str::startsWith($event->key, ['laritor']) || !FilterHelper::recordCacheHit($event->key) ) { return; diff --git a/src/Recorders/CommandRecorder.php b/src/Recorders/CommandRecorder.php index 48b4a03..19f1bc4 100644 --- a/src/Recorders/CommandRecorder.php +++ b/src/Recorders/CommandRecorder.php @@ -122,6 +122,19 @@ public function ignore($command) 'queue:work', 'queue:listen', 'octane:install', + 'auth:clear-resets', + 'config:cache', + 'horizon:snapshot', + 'horizon:status', + 'horizon:supervisor', + 'inertia:start-ssr', + 'invoke-serialized-closure', + 'model:prune', + 'nightwatch:agent', + 'nightwatch:status', + 'queue:monitor', + 'reverb:start', + 'schedule:list', 'laritor:sync', 'laritor:send-metrics' ]);