statsd gearman metrics collector in PHP

dev-master 2016-04-18 22:23 UTC

This package is not auto-updated.

Last update: 2022-06-22 13:10:57 UTC


Build Status

Gearman metrics collector for statsd written in PHP.

Install using composer:

composer require petrica/statsd-gearman


  • PHP ^5.5

Run with:

vendor/bin/statsd-console statsd:notify --verbose gauges.yml

Please have a look at the main statsd library here.

Sample config file:

The configuration file is pretty straightforward, you specify the gauge class name and class arguments

        class: Petrica\StatsdGearman\Gauge\GearmanGauge
            server: localhost:4730
            timeout: 1

Where we have the following parameters:

server - Gearman server host and port

server: [host]:[port]

timeout - Connection timeout in seconds

timeout: [seconds]


Having statsd integrated with graphite, you will find gearman metrics under:

stats.gauges.system.gearman.[job_name].queue - number of jobs in queue
stats.gauges.system.gearman.[job_name].running - number of running workers
stats.gauges.system.gearman.[job_name].workers - number of available workers

Here is an example of how a graph might look like for all stats aggregated:

Gearman Stats

In this example we have 27 available workers, around 20 jobs in queue and around 7 active workers every 5 minutes. Of course this example doesn't tell much about gearman load, but tracking each job individually will get you enough information to know if you need to span additional workers in order to keep up with the flow of jobs.

Here is the graph URL: