PHPackages                             crazybooot/jobs-stats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. crazybooot/jobs-stats

ActivePackage[Queues &amp; Workers](/categories/queues)

crazybooot/jobs-stats
=====================

Laravel 5.5 package to collect queue statistics

6225[13 issues](https://github.com/crazybooot/queue-stats/issues)JavaScript

Since Nov 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/crazybooot/queue-stats)[ Packagist](https://packagist.org/packages/crazybooot/jobs-stats)[ RSS](/packages/crazybooot-jobs-stats/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel package for queued job statistics collecting

Install
-------

[](#install)

- Install composer package to your laravel project

```
$ composer require crazybooot/queue-stats
```

- Add service provider to config/app.php

```
    'providers' => [
        ...
        Crazybooot\QueueStats\Providers\QueueStatsServiceProvider::class,
    ],
```

- Publish migrations

```
$ php artisan vendor:publish --provider="Crazybooot\QueueStats\Providers\QueueStatsServiceProvider" --tag="migrations"
```

- Run migrations

```
$ php artisn migrate
```

- Use QueueStatsTrait and QueueStatsInterface on jobs models you want to collect statistics

```
...
use Crazybooot\QueueStats\Traits\QueueStatsTrait;
use Crazybooot\QueueStats\Interfaces\QueueStatsInterface;

class ExampleJob implementes QueueStatsInterface, ShouldQueue
{
    use QueueStatsTrait;
}
```

- As well you can use extended artisan command to generate job with QueueStatsTrait and QueueStatsInterface. Just add `StatJobMakeCommand` command to the `app/Console/Kernel.php`. `php artisan make:job` would be override by this command.

```
    protected $commands = [
        ...
        Crazybooot\QueueStats\Make\StatJobMakeCommand::class
    ];
```

Using
-----

[](#using)

Get statistics about jobs:

```
...
use Crazybooot\QueueStats\Models\Job;

...
// get failed jobs
Job::failed()->get();

// get success jobs
Job::success()->get();

// get not handled jobs
Job::notHandled()->get();

// get jobs handled on specified queue
Job::queue('default')->get();

// get jobs on specified connection
Job::connection('redis')->get();

// get jobs with specified class
Job::class(ExampleJob::class)->get();

// get jobs with specified number of attempts
Job::attemptsCount(3)->get();

// get jobs which has result
Job::withResult()->get();

// get jobs which have no result
Job::withoutResult()->get();

// get jobs with specified type
Job::type('custom_type')->get();

// get jobs without type
Job::withoutType()->get();
```

You can get statistics about one job by using getUuid() method on job instance before dispatching job:

```
...
use Crazybooot\QueueStats\Models\Job;
use App\Job\ExampleJob;

...

$job = new ExampleJob();
$uuid = $job->getUuid();

...

dispath($job);

...

$jobStats = Job::where('uuid', $uuid)->first();

// returns total job atempts waiting on queue duration in seconds
$waitingDuration = $jobStats->getAttribute('waiting_duration');

// returns total job atempts handling duration in seconds
$handlingDuration = $jobStats->getAttribute('handling_duration);

// return job attempts count
$attemptsCount = $jobStats->getAttribute('attempts_count');
```

You can add some job results to statistics passing array of data you want to save $this-&gt;saveResult(). Result will be stored in database in json format what allows to query more complex data with Eloquent or Query Builder.

```
use Crazybooot\QueueStats\Traits\QueueStatsTrait;

class ExampleJob implementes ShouldQueue
{
    use QueueStatsTrait;

    ...

    public function handle()
    {

    ...

    $this->saveResult([
        'some_key' => [
            'some_key' => 'some_payload'
        ]
    ]);
    }
}
```

Requirements
------------

[](#requirements)

- PHP: 7.0+
- Laravel: 5.5
- Supported queue drivers: database, beanstalkd, redis

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4480913?v=4)[Anton Medved](/maintainers/crazybooot)[@crazybooot](https://github.com/crazybooot)

---

Top Contributors

[![crazybooot](https://avatars.githubusercontent.com/u/4480913?v=4)](https://github.com/crazybooot "crazybooot (24 commits)")

### Embed Badge

![Health badge](/badges/crazybooot-jobs-stats/health.svg)

```
[![Health](https://phpackages.com/badges/crazybooot-jobs-stats/health.svg)](https://phpackages.com/packages/crazybooot-jobs-stats)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M30](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6045.5M508](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[jayazhao/think-queue-rabbitmq

为 ThinkPHP5.1 队列增加 RabbitMQ 驱动

141.5k](/packages/jayazhao-think-queue-rabbitmq)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
