2017 © Pedro Peláez
 

yii2-extension yii2-queue-monitor

Yii2 Queue Analytics Module

image

zhuravljov/yii2-queue-monitor

Yii2 Queue Analytics Module

  • Thursday, May 31, 2018
  • by Zhuravljov
  • Repository
  • 7 Watchers
  • 28 Stars
  • 2,064 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 1 Versions
  • 31 % Grown

The README.md

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., (*1)

Latest Stable Version Total Downloads Scrutinizer Code Quality, (*2)

Installation

The preferred way to install the extension is through composer. Add to the require section of your composer.json file:, (*3)

"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:, (*4)

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:, (*5)

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:, (*6)

'controllerMap' => [
    'migrate' => [
        'class' => \yii\console\controllers\MigrateController::class,
        'migrationNamespaces' => [
            //...
            'zhuravljov\yii\queue\monitor\migrations',
        ],
    ],
],

And apply migrations., (*7)

Web

Finally, modify your web config file to turn on web interface:, (*8)

return [
    'bootstrap' => [
        'monitor',
    ],
    'modules' => [
        'monitor' => [
            'class' => \zhuravljov\yii\queue\monitor\Module::class,
        ],
    ],
];

It will be available by URL http://yourhost.com/monitor., (*9)

Console

There is console garbage collector:, (*10)

'controllerMap' => [
    'monitor' => [
        'class' => \zhuravljov\yii\queue\monitor\console\GcController::class,
    ],
],

It can be executed as:, (*11)

php yii monitor/clear-deprecated P1D

Where P1D is interval spec that specifies to delete all records one day older., (*12)

The Versions

31/05 2018

dev-master

9999999-dev

Yii2 Queue Analytics Module

  Sources   Download

BSD-3-Clause

The Requires

 

by Roman Zhuravlev

analytics module yii queue