2017 © Pedro Peláez
 

library laravel-queue-monitor

A Laravel package to monitor queue jobs.

image

gilbitron/laravel-queue-monitor

A Laravel package to monitor queue jobs.

  • Tuesday, January 17, 2017
  • by gilbitron
  • Repository
  • 1 Watchers
  • 8 Stars
  • 3,928 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 3 Open issues
  • 2 Versions
  • 16 % Grown

The README.md

Laravel Queue Monitor

A Laravel package to monitor queue jobs. Logs certain information about queue jobs in a database table:, (*1)

  • The elapsed time of the job including start and finish timestamps
  • If --tries is being used the attempt number for each job
  • If the job failed and the exception given (if available)
  • Custom data (optional)

Requirements

  • Laravel 5.3+

Install

Install the composer package:, (*2)

composer require gilbitron/laravel-queue-monitor

Add the service provider in config/app.php:, (*3)

/*
 * Package Service Providers...
 */
Gilbitron\LaravelQueueMonitor\LaravelQueueMonitorProvider::class,

Run a migration to setup the queue_monitor database table:, (*4)

php artisan migrate

Usage

All queue jobs will now be monitored and results stored to the queue_monitor database table. No other configuration is required., (*5)

Custom Data

To save custom data with the queue monitor results you need to include the QueueMonitorData trait in your Job and use the saveQueueMonitorData() method. For example:, (*6)

<?php

namespace App\Jobs;

use Gilbitron\LaravelQueueMonitor\Jobs\QueueMonitorData;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class ExampleJob implements ShouldQueue
{
    use InteractsWithQueue, Queueable, SerializesModels, QueueMonitorData;

    protected $results = 0;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $this->results = rand(1, 100);

        $this->saveQueueMonitorData([
            'results' => $this->results,
        ]);

        // ...
    }
}

Credits

Laravel Queue Monitor was created by Gilbert Pellegrom from Dev7studios. Released under the MIT license., (*7)

The Versions

17/01 2017

dev-master

9999999-dev

A Laravel package to monitor queue jobs.

  Sources   Download

MIT

laravel queue monitor

17/01 2017

1.0.0

1.0.0.0

A Laravel package to monitor queue jobs.

  Sources   Download

MIT

laravel queue monitor