yii2-queue-monitor

Yii2 Queue Analytics Module

  • 所有者: zhuravljov/yii2-queue-monitor
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Yii2 Queue Analytics Module

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.

Latest Stable Version
Total Downloads
Scrutinizer Code Quality

Installation

The preferred way to install the extension is through composer.
Add to the require section of your composer.json file:

"zhuravljov/yii2-queue-monitor": "~0.1"

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.

主要指标

概览
名称与所有者zhuravljov/yii2-queue-monitor
主编程语言PHP
编程语言PHP (语言数: 6)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2017-06-17 02:36:03
推送于2023-12-07 12:31:25
最后一次提交2020-08-05 00:11:40
发布数9
最新版本名称0.3.4 (发布于 )
第一版名称0.1.0 (发布于 )
用户参与
星数102
关注者数12
派生数24
提交数136
已启用问题?
问题数21
打开的问题数9
拉请求数3
打开的拉请求数3
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?