Skip to content
No description or website provided.
PHP Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Queue Profiling

Provides a ProfilingConsumer and set of handler decorators that can profile messages once or while the queue is running via SIGUSR1 (or other) posix signals.


Pick an appropriate handler for your setup.

  • PMG\Queue\Handler\BlackfireProfilingHandler - Profile with

All profiling handlers are decorators, so you'll create a real message handler and decorate it with the profiling handler.

use PMG\Queue\Message;
use PMG\Queue\ProfilingConsumer;
use PMG\Queue\Handler\CallableHandler;
use PMG\Queue\Handler\BlackfireProfilingHandler;

$realHandler = new CallableHandler(function (Message $message) {
    // do stuff

$profilingHandler = BlackfireProfilingHandler::createDefault($realHandler);

If you plan on forking new processes to handle messages with PcntlForkingHandler, decorate the profiling handler with it.

use PMG\Queue\Handler\PcntlForkingHandler;

$forkingHandler = new PcntlForkingHandler($profilingHandler);

Instantiate a Consumer Like Normal

use PMG\Queue\ProfilingConsumer

$consumer = new ProfilingConsumer($driver, $profilingHandler);

Enable or Disable Profiling or Let the Signal Handlers Take Care of It

// let the signal handler do their thing(s)

// or enable/disable profiling manually

You can’t perform that action at this time.