LaravelPackages.net
Acme Inc.
Toggle sidebar
happydemon/nova-horizon

Horizon statistics in Nova

24
0
1.0.2
About happydemon/nova-horizon

happydemon/nova-horizon is a Laravel package for horizon statistics in nova. It currently has 0 GitHub stars and 24 downloads on Packagist (latest version 1.0.2). Install it with composer require happydemon/nova-horizon. Discover more Laravel packages by happydemon or browse all Laravel packages to compare alternatives.

Last updated

Nova Horizon

Latest Version on Packagist Total Downloads Software License

Add statistics to your Nova dashboard for 1 or more applications that are running horizon.

This is a fork of appstract/nova-horizon, some key differences:

  • You can configure multiple horizon instances
  • Improved request handling

dashboard

Installation

You can install the package via composer:

composer require happydemon/nova-horizon
php artisan vendor:publish --tag nova-horizon

Configuration

You will have to define your horizon instances in the nova-horizon.php config file.

<?php
 return [
     'default_instance' => 'default',

     'instances' => [
         'default' => [
             // url to where horizon is accessible
             'url' => 'https://yourapp.com/horizon',
             'auth' => [
                // Delete this section if not using basic auth to autheticate horizon requests
             ],
             'headers' => [
                // if using headers for authentication, add them here
             ]
         ],
     ]
 ];

The instance key can be passed to the cards by calling ->horizonInstance('{KEY}').

Usage

You can add cards to the main dashboard or your own dashboard(s).

class Main extends Dashboard
{
    public function cards()
    {
        return [
            \HappyDemon\NovaHorizon\Cards\Stats::make()
                ->horizonInstance('default'),
            \HappyDemon\NovaHorizon\Cards\Workload::make(),
            \HappyDemon\NovaHorizon\Cards\PendingJobs::make(),
            \HappyDemon\NovaHorizon\Cards\FailedJobs::make(),
            \HappyDemon\NovaHorizon\Cards\CompletedJobs::make(),

            // Stats as separate cards
            \HappyDemon\NovaHorizon\Cards\JobsPerMinute::make(),
            \HappyDemon\NovaHorizon\Cards\RecentJobsCount::make(),
            \HappyDemon\NovaHorizon\Cards\FailedJobsCount::make(),
            \HappyDemon\NovaHorizon\Cards\Status::make(),
            \HappyDemon\NovaHorizon\Cards\TotalProcesses::make(),
            \HappyDemon\NovaHorizon\Cards\MaxWaitTime::make(),
            \HappyDemon\NovaHorizon\Cards\MaxRuntime::make(),
            \HappyDemon\NovaHorizon\Cards\MaxThroughput::make(),
        ];
    }
}

Contributing

Contributions are welcome, thanks to all the contributors :)

License

The MIT License (MIT). Please see License File for more information.

Comments