Skip to content

Commit

Permalink
mysql-count-per-user
Browse files Browse the repository at this point in the history
  • Loading branch information
Saifallak committed Nov 3, 2023
1 parent 51eafac commit a56c914
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('show status where variable_name = "threads_connected"')->Value,
$connection instanceof MySqlConnection => (int) $connection->selectOne('SELECT COUNT(*) FROM information_schema.PROCESSLIST')->{"COUNT(*)"},
$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 a56c914

Please sign in to comment.