Skip to content

Commit

Permalink
Merge pull request #160 from maxkalahur/bug/connection-count
Browse files Browse the repository at this point in the history
mysql connection count fix
  • Loading branch information
freekmurze authored Feb 15, 2023
2 parents 2755ff3 + 0ed1b62 commit 1ba2f21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Support/DbConnectionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DbConnectionInfo
public function connectionCount(ConnectionInterface $connection): int
{
return match (true) {
$connection instanceof MySqlConnection => (int) $connection->selectOne($connection->raw('show status where variable_name = "threads_connected"'))->Value,
$connection instanceof MySqlConnection => (int) $connection->selectOne('show status where variable_name = "threads_connected"')->Value,
$connection instanceof PostgresConnection => (int) $connection->selectOne('select count(*) as connections from pg_stat_activity')->connections,
default => throw DatabaseNotSupported::make($connection),
};
Expand Down

0 comments on commit 1ba2f21

Please sign in to comment.