Laravel 10.x以降のartisanの「db:monitor」コマンドを解説します。
Description
指定したデータベースの接続数を監視します。
Usage
php artisan db:monitor [--databases [DATABASES]] [--max [MAX]]Options
| オプション | 省略形 | 必須 | 説明 |
|---|---|---|---|
| databases | – | – | 監視するデータベース接続 |
| max | – | – | イベントがディスパッチされるまでに開くことができる最大接続数 |
Example
no options
php artisan db:monitor Database name ........................................................................................................................ Connections
mysql ..................................................................................................................................... [1] OKwith database and max
php artisan db:monitor --database=mysql --max=50 INFO Monitoring database connections for [mysql]...
Current connection count: 5


コメント