2017 © Pedro Peláez
 

library queue-profiling

Profile running queues with various libraries and SaaS products.

image

pmg/queue-profiling

Profile running queues with various libraries and SaaS products.

  • Sunday, August 28, 2016
  • by chrisguitarguy
  • Repository
  • 7 Watchers
  • 0 Stars
  • 6,703 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

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., (*1)

Usage

Pick an appropriate handler for your setup.

  • PMG\Queue\Handler\BlackfireProfilingHandler - Profile with blackfire.io

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

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., (*3)

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)
$consumer->run('SomeQueue');

// or enable/disable profiling manually
$consumer->enableProfiling();
$consumer->once('SomeQueue');

$consumer->disableProfiling();
$consumer->once('SomeQueue');

The Versions

28/08 2016

dev-master

9999999-dev

Profile running queues with various libraries and SaaS products.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

28/08 2016

0.1.0

0.1.0.0

Profile running queues with various libraries and SaaS products.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires