andrey-zhukovskiy/yii2-queue-monitor
最新稳定版本:1.1
Composer 安装命令:
composer require andrey-zhukovskiy/yii2-queue-monitor
包简介
Yii2 Queue Analytics Module
关键字:
README 文档
README
The module collects statistics about working of queues of an application, and provides web interface for research. Also the module allows to stop and replay any jobs manually.
Installation
The preferred way to install the extension is through composer.
Add to the require section of your composer.json file:
"andrey-zhukovskiy/yii2-queue-monitor": "~0.2"
Usage
To configure the statistics collector, you need to add monitor behavior for each queue component. Update common config file:
return [ 'components' => [ 'queue' => [ // ... 'as jobMonitor' => \zhuravljov\yii\queue\monitor\JobMonitor::class, 'as workerMonitor' => \zhuravljov\yii\queue\monitor\WorkerMonitor::class, ], ], ];
There are storage options that you can configure by common config file:
return [ 'container' => [ 'singletons' => [ \zhuravljov\yii\queue\monitor\Env::class => [ 'cache' => 'cache', 'db' => 'db', 'pushTableName' => '{{%queue_push}}', 'execTableName' => '{{%queue_exec}}', 'workerTableName' => '{{%queue_worker}}', ], ], ], ];
If you want use migrations of the extension, configure migration command in console config:
'controllerMap' => [ 'migrate' => [ 'class' => \yii\console\controllers\MigrateController::class, 'migrationNamespaces' => [ //... 'zhuravljov\yii\queue\monitor\migrations', ], ], ],
And apply migrations.
Web
Finally, modify your web config file to turn on web interface:
return [ 'bootstrap' => [ 'monitor', ], 'modules' => [ 'monitor' => [ 'class' => \zhuravljov\yii\queue\monitor\Module::class, ], ], ];
It will be available by URL http://yourhost.com/monitor.
Console
There is console garbage collector:
'controllerMap' => [ 'monitor' => [ 'class' => \zhuravljov\yii\queue\monitor\console\GcController::class, ], ],
It can be executed as:
php yii monitor/clear-deprecated P1D
Where P1D is interval spec that specifies to delete all records one day older.
统计信息
- 总下载量: 464
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2023-06-30