Resqueboard dashboard preview

ResqueBoard

Analytics for Resque PHP

ResqueBoard is an analytics software for PHP Resque. Monitor your workers health and job activities in realtime.

Install

Requirements

Install

There are three parts to install :

ResqueBoard

  1. Clone the github repository somewhere accessible by your webserver

    git clone git://github.com/kamisama/ResqueBoard.git

    Or you can alternatively download it directly

  2. Install dependencies

    cd ./ResqueBoard
    # If you have not installed Composer yet
    curl -s https://getcomposer.org/installer | php
    php composer.phar install

ResqueBoard should now be accessible via http://localhost/ResqueBoard/src/ResqueBoard/webroot/.

For security reasons, you should configure a virtual host in you webserver to redirect to ResqueBoard/src/ResqueBoard/webroot/, and leave all other folders unavailable to the public.

Cube

Cube is a system for collecting timestamped events and deriving metrics. By collecting events rather than metrics, Cube lets you compute aggregate statistics post hoc. It also enables richer analysis, such as quantiles and histograms of arbitrary event sets. http://square.github.com/cube/
Cube requires MongoDB, NodeJS and npm. Refer to their respective websites for installation instruction.
  1. Install Cube

    npm install cube
    # OR: git clone https://github.com/square/cube.git
    cd cube
    npm install
  2. Start the cube server

    node bin/collector.js 2>&1 >> /var/log/cube/collector.log &
    node bin/evaluator.js 2>&1 >> /var/log/cube/evaluator.log &
Refer to Cube's wiki for full instruction.

Php-Resque-Ex

Php-Resque-Ex is a port of php-resque with more logging options, essential to send log to Cube via an UDP socket.

Chance are if you need an analytics tools for Resque PHP, you already have php-resque installed.

git clone https://github.com/kamisama/php-resque-ex.git
cd ./php-resque-ex
# Install Composer if not already done
curl -s https://getcomposer.org/installer | php
php composer.phar install

Replace you current php-resque library with this new one.

Patch Cube

The cube module need to be patched to output more informations. cd into node_modules/cube/lib/cube and edit the file event.js.

Around lines 173-174, search for

// Request any needed fields.
var fields = {t: 1};

Replace by

// Request any needed fields.
var fields = {t: 1, d: 1};

This will make cube send all event's data when polling for new events. Restart the cube server.

Don't forget to repeat this step each time you update Cube.

Configuration

All configurations are database connections related.

Php-Resque

Php-Resque-Ex works the same as php-resque. One of the additional features are the LOGHANDLER and LOGHANDLERTARGET environment variable, used to redirect the log output to a specific log engine.

When starting your workers, set the :

This will redirect all the logs to the Cube server.

Example when starting a worker with raw terminal command

QUEUE=default LOGHANDLER='Cube' LOGHANDLERTARGET='udp://127.0.0.1:1180' php bin/resque

Example when starting a worker with fresque

fresque start --loghandler='Cube' --handlertarget='udp://127.0.0.1:1180'

You can also set them as default in fresque.ini, to avoid using --loghandler each time.

Example when starting a worker with CakeResque

cake CakeResque.CakeResque start --log-handler='Cube' --log-handler-target='udp://127.0.0.1:1180'

You can also set them as default in the CakeResque bootstrap, to avoid using --log-handler each time.

ResqueBoard

ResqueBoard configuration are located in ResqueBoard/src/ResqueBoard/Config/Core.php.

All settings are by default commented, you should decomment and edit them only if your settings are different.

$settings = array(
	/*'mongo' => array(
	 'host' => 'localhost',
		'port' => 27017,
		'database' => 'cube_development'
	),*/
	/* 'redis' => array(
		'host' => '127.0.0.1',
		'port' => 6379
	),*/
	'readOnly' => false,
	/*'resquePrefix' => 'resque',*/
	/*'resqueConfig' => __DIR__ . DIRECTORY_SEPARATOR . './resque.ini'*/
);

ReadOnly

Set to true to enable stopping and pausing workers from the web interface.

resqueConfig

Not used yet

Update

  1. Backup your Core.php if you've made some changes.
  2. Download the new version of ResqueBoard and replace only the src folder, or update from the git repo if you have choosed to clone it.
  3. Update your dependencies by running php composer.phar update
  4. Restore you Core.php
  5. Read the Releases Notes for any manual updates to Core.php

Support

All support, bugs submissions and feature requests are tracked on Github.

Licence

RequestBoard is licensed under the MIT License.

Author

Wan Qi Chen

Credits

ResqueBoard favicon from Fugue Icons, by Yusuke Kamiyamane.