diff --git a/src/Dibi/Bridges/Tracy/Panel.php b/src/Dibi/Bridges/Tracy/Panel.php index 0c59bbd1..8731e25c 100644 --- a/src/Dibi/Bridges/Tracy/Panel.php +++ b/src/Dibi/Bridges/Tracy/Panel.php @@ -105,6 +105,15 @@ class Panel implements Tracy\IBarPanel } $totalTime = $s = null; + + $singleConnection = reset($this->events)->connection; + foreach ($this->events as $event) { + if ($event->connection !== $singleConnection) { + $singleConnection = null; + break; + } + } + foreach ($this->events as $event) { $totalTime += $event->time; $connection = $event->connection; @@ -135,7 +144,10 @@ class Panel implements Tracy\IBarPanel $s .= Tracy\Helpers::editorLink($event->source[0], $event->source[1]);//->class('tracy-DibiProfiler-source'); } - $s .= "{$event->count}"; + $s .= "{$event->count}"; + if (!$singleConnection) { + $s .= '' . htmlspecialchars($this->getConnectionName($connection)) . ''; + } } return '

Queries: ' . count($this->events) . ($totalTime === null ? '' : ', time: ' . number_format($totalTime * 1000, 1, '.', ' ') . ' ms') . ', ' - . htmlspecialchars($connection->getConfig('driver') . ($connection->getConfig('name') ? '/' . $connection->getConfig('name') : '') - . ($connection->getConfig('host') ? ' @ ' . $connection->getConfig('host') : '')) . '

+ . htmlspecialchars($this->getConnectionName($singleConnection)) . '
- ' . $s . ' + ' . (!$singleConnection ? '' : '') . ' + ' . $s . '
Time msSQL StatementRows
Time msSQL StatementRowsConnection
'; } + + + private function getConnectionName(Dibi\Connection $connection): string + { + return $connection->getConfig('driver') + . ($connection->getConfig('name') ? '/' . $connection->getConfig('name') : '') + . ($connection->getConfig('host') ? ' @ ' . $connection->getConfig('host') : ''); + } }