striebwj/horizon-stats

0.1.0 2021-07-04 18:28 UTC

This package is auto-updated.

Last update: 2024-05-05 00:42:59 UTC


README

Run tests Format (PHP)

Packagist Packagist Packagist

Store long-term stats on the health of your Horizon Queues.

This package takes the Horizon snapshot data and stores it in the database, with easy to access models, so you can track your queue health over time.

Installation

Install via composer

composer require striebwj/horizon-stats

Publish package assets

php artisan vendor:publish --provider="striebwj\HorizonStats\ServiceProvider"

Update the horizon-stats.php config file to change the database names. Default is horizon_stats.

Usage

Once migrations are run, add the horizon-stats:store command to your App\Console\Kernel.php with the same time as your Horizon Snapshot command. Be sure to add it before the snapshot. It should look something like this:

// Horizon Tasks
$schedule->command('horizon-stats:store')->everyFiveMinutes(); // Before the snapshot
$schedule->command('horizon:snapshot')->everyFiveMinutes();

To-do List

  • Add tests
  • Allow pushing storing in DB to a queue
  • Add pruning?

Security

If you discover any security related issues, please email wade@striebel.ca instead of using the issue tracker.

Credits