PHP code example of jrdnrc / queue-stats

1. Go to this page and download the library: Download jrdnrc/queue-stats library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jrdnrc / queue-stats example snippets



    return [
        // ...
    
        /**
         * Define your workers here, including the redis connection,
         * the queues they are running, and how many
         * processes each worker should run
         */
        'queues' => [
            'default' => [
                'connection' => 'redis',
                'queue'      => ['default'],
                'processes'  => 1,
            ],
            
            'media-processing' => [
                'connection' => 'redis2',
                'queue'      => ['image-transforming', 'video-transforming'],
                'processes'  => 5,
            ],
        ],
    ];

$ php artisan queue:stats 
+--------------------+----------+-----------------------+---------+-----------+
| Queue              | In Queue | Reserved (Processing) | Delayed | Processes |
+--------------------+----------+-----------------------+---------+-----------+
| default            | 20       | 1                     | 0       | 1         |
| image-transforming | 0        | 0                     | 2       | 5         |
| video-transforming | 1        | 2                     | 0       | 5         |
+--------------------+----------+-----------------------+---------+-----------+
| Total:             | 21       | 0                     | 2       | 11        |
+--------------------+----------+-----------------------+---------+-----------+