PHPackages                             tomschlick/php-resque-statsd - 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. tomschlick/php-resque-statsd

AbandonedLibrary

tomschlick/php-resque-statsd
============================

Submit metrics for your php-resque jobs into StatsD/Graphite

044PHP

Since May 3Pushed 13y ago1 watchersCompare

[ Source](https://github.com/tomschlick/php-resque-statsd)[ Packagist](https://packagist.org/packages/tomschlick/php-resque-statsd)[ RSS](/packages/tomschlick-php-resque-statsd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-resque-statsd: PHP Resque StatsD
====================================

[](#php-resque-statsd-php-resque-statsd)

php-resque-statsd implements [StatsD](http://github.com/etsy/statsd) metric tracking into php-resque.

For each job picked up by php-resque, numerous metrics will be submitted to StatsD, including counters to track the number of jobs executed, and timers to track how much time php-resque workers spend working.

php-resque-statsd also includes support for tracking metrics for jobs scheduled with [php-resque-scheduler](http://github.com/chrisboulton/php-resque-scheduler). The appropriate listeners to track scheduled jobs are automatically registered, so no extra work is required on your behalf.

Using php-resque-statsd
-----------------------

[](#using-php-resque-statsd)

php-resque-statsd exists as a single class (`lib/ResqueStatsd.php`), which has no additional dependencies beyond php-resque itself.

To start tracking your jobs with StatsD, all you need to do is include `ResqueStatsd.php` in your project.

If you're starting php-resque with the resque.php script supplied with php-resque, all that is required is a modification to the bootstrap file you supply to php-resque via the `APP_INCLUDE` environment variable:

```
require_once '/path/to/ResqueStatsd.php';

```

### StatsD Connection Details

[](#statsd-connection-details)

php-resque-scheduler will automatically check for the following environment variables if they exist and use them when connecting to StatsD:

- `STATSD_HOST` / `STATSD_PORT`
- `GRAPHITE_HOST`

To ease integration with existing setups, if either `STATSD_HOST` or `GRAPHITE_HOST` include a single colon and then one or more numbers, this will be interpretted as a HOST:PORT combination and both the host and port will be set accordingly.

If you don't use environment variables in your project, you can still tell php-resque-statsd where StatsD is located:

```
$host = '127.0.0.1';
$port = 8579;

require_once '/path/to/ResqueStatsd.php';
Resque_Statsd::setServer($host, $port);

```

Metrics
-------

[](#metrics)

php-resque-statsd prefixes all metrics it generates with `resque`. You can override this behavior if desired:

```
require_once '/path/to/ResqueStatsd.php';
Resque_Statsd::setPrefix('resque.production');

```

### Queue Based Metrics

[](#queue-based-metrics)

The metrics below are tracked for each queue, instead of each unique job:

- **stats.resque.queue.QUEUE\_NAME.enqueued**Counter of the number of jobs enqueued in this queue
- **stats.resque.queue.QUEUE\_NAME.finished**Counter of the number of jobs successfully processed in this queue
- **stats.resque.queue.QUEUE\_NAME.failed**Counter of the number of jobs that failed in this queue
- **stats.timers.queue.QUEUE\_NAME.processed**Timer for jobs processed in this queue
- **stats.resque.queue.QUEUE\_NAME.scheduled**If using php-resque-scheduler, number of jobs scheduled for future execution in this queue

For example, for all jobs executed in the queue `transcode`, the following StatsD metrics will be created:

- stats.resque.queue.transcode.enqueued
- stats.resque.queue.transcode.finished
- stats.resque.queue.transcode.failed
- stats.timers.resque.queue.transcode.processed
- stats.resque.queue.transcode.scheduled

### Job Based Metrics

[](#job-based-metrics)

Metrics are also tracked on a job level:

- **stats.resque.job.JOB\_CLASS.enqueued**Counter for the number of times this job has been enqueued
- **stats.resque.job.JOB\_CLASS.finished**Counter for the number of times this job has been successfully processed
- **stats.resque.job.JOB\_CLASS.failed**Counter for the number of times this job has failed
- **stats.timers.job.JOB\_CLASS.processed**Timer for the amount of time spent processing this job
- **stats.resque.job.JOB\_CLASS.scheduled**If using php-resque-scheduler, number of of times this job has been scheduled for future execution

For example, a job named `Job_SendEmail` the following metrics will be created:

- stats.resque.job.Job\_SendEmail.enqueued
- stats.resque.job.Job\_SendEmail.finished
- stats.resque.job.Job\_SendEmail.failed
- stats.timers.resque.job.Job\_SendEmail.processed
- stats.resque.job.Job\_SendEmail.scheduled

Contributors
------------

[](#contributors)

- chrisboulton

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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://www.gravatar.com/avatar/b116525a1bd1456044dc2edc80dd04a09806549a38945eb9b905b143a642c4bd?d=identicon)[tomschlick](/maintainers/tomschlick)

---

Top Contributors

[![tomschlick](https://avatars.githubusercontent.com/u/70184?v=4)](https://github.com/tomschlick "tomschlick (1 commits)")

### Embed Badge

![Health badge](/badges/tomschlick-php-resque-statsd/health.svg)

```
[![Health](https://phpackages.com/badges/tomschlick-php-resque-statsd/health.svg)](https://phpackages.com/packages/tomschlick-php-resque-statsd)
```

PHPackages © 2026

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