From a56c914fb9071e3c6b827ba8a2772a243f7cc464 Mon Sep 17 00:00:00 2001 From: Saifallak Date: Fri, 3 Nov 2023 16:43:59 +0200 Subject: [PATCH] mysql-count-per-user --- src/Support/DbConnectionInfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/DbConnectionInfo.php b/src/Support/DbConnectionInfo.php index b7c85d86..544d208d 100644 --- a/src/Support/DbConnectionInfo.php +++ b/src/Support/DbConnectionInfo.php @@ -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), };