Download the PHP package romanzipp/laravel-queue-monitor without Composer
On this page you can find all versions of the php package romanzipp/laravel-queue-monitor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download romanzipp/laravel-queue-monitor
More information about romanzipp/laravel-queue-monitor
Files in romanzipp/laravel-queue-monitor
Package laravel-queue-monitor
Short Description Queue Monitoring for Laravel Database Job Queue
License MIT
Informations about the package laravel-queue-monitor
Laravel Queue Monitor
This package offers monitoring like Laravel Horizon for database queue.
Features
- Monitor jobs like Laravel Horizon for any queue
- Handle failing jobs with storing exception
- Monitor job progress
- Get an estimated time remaining for a job
- Store additional data for a job monitoring
- Retry jobs via the UI
Installation
There is an additional package romanzipp/Laravel-Queue-Monitor-Nova for Laravel Nova resources & metrics.
Upgrading
✨ See Upgrade Guide if you are updating to 5.0 ✨
Configuration
Copy configuration & migration to your project:
Migrate the Queue Monitoring table. The table name can be configured in the config file or via the published migration.
Usage
To monitor a job, simply add the romanzipp\QueueMonitor\Traits\IsMonitored
Trait.
Important! You need to implement the Illuminate\Contracts\Queue\ShouldQueue
interface to your job class. Otherwise, Laravel will not dispatch any events containing status information for monitoring the job.
Web Interface
You can enable the web UI by setting the ui.enabled
to true
configuration value.
Publish frontend assets:
See the full configuration file for more information.
Commands
artisan queue-monitor:stale
This command mark old monitor entries as stale
. You should run this command regularly in your console kernel.
Arguments & Options:
--before={date}
The start date before which all entries will be marked as stale--beforeDays={days}
The relative amount of days before which entries will be marked as stale--beforeInterval={interval}
An interval date string before which entries will be marked as stale--dry
Dry-run only
artisan queue-monitor:purge
This command deletes old monitor models.
Arguments & Options:
--before={date}
The start date before which all entries will be deleted--beforeDays={days}
The relative amount of days before which entries will be deleted--beforeInterval={interval}
An interval date string before which entries will be deleted--queue={queue}
Only purge certain queues (comma separated values)--only-succeeded
Only purge succeeded entries--dry
Dry-run only
Either the before or beforeDate arguments are required.
Advanced usage
Progress
You can set a progress value (0-100) to get an estimation of a job progression.
Chunk progress
A common scenario for a job is iterating through large collections.
This example job loops through a large amount of users and updates its progress value with each chunk iteration.
Progress cooldown
To avoid flooding the database with rapidly repeating update queries, you can set override the progressCooldown
method and specify a length in seconds to wait before each progress update is written to the database. Notice that cooldown will always be ignore for the values 0, 25, 50, 75 and 100.
Custom data
This package also allows setting custom data in array syntax on the monitoring model.
In order to show custom data on UI you need to add this line under config/queue-monitor.php
Initial data
This package also allows setting initial data to set when the job is queued.
Only keep failed jobs
You can override the keepMonitorOnSuccess()
method to only store failed monitor entries of an executed job. This can be used if you only want to keep failed monitors for jobs that are frequently executed but worth to monitor. Alternatively you can use Laravel's built in failed_jobs
table.
Retrieve processed Jobs
Model Scopes
Tests
The easiest way to execute tests locally is via Lando. The Lando config file automatically spins up app & database containers.
Upgrading
License
The MIT License (MIT). Please see License File for more information.
This package was inspired by gilbitron's laravel-queue-monitor which is not maintained anymore.
All versions of laravel-queue-monitor with dependencies
ext-json Version *
ext-mbstring Version *
illuminate/database Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/queue Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
nesbot/carbon Version ^2.0|^3.0