Skip to content

Commit

Permalink
Omit connection name if default
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiergummi committed Sep 20, 2022
1 parent bc17f95 commit 9512aba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Subscribers/EloquentSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public function handleQuery(QueryExecuted $event): void

public function handleTotal(QueryExecuted $event): void
{
$key = 'Database (' . ($event->connectionName) . ')';
$key = 'Database';

if ($event->connectionName && $event->connectionName !== 'default') {
$key .= " ({$event->connectionName})";
}

$previous = $this->timing->getDuration($key) ?? 0.0;
$this->timing->setDuration($key, $previous + $event->time);
Expand Down

0 comments on commit 9512aba

Please sign in to comment.