2017 © Pedro Peláez
 

library guzzle-profiler

A Guzzle middleware that profiles requests made by the client.

image

hannesvdvreken/guzzle-profiler

A Guzzle middleware that profiles requests made by the client.

  • Monday, November 30, 2015
  • by hannesvdvreken
  • Repository
  • 0 Watchers
  • 4 Stars
  • 34,507 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 12 % Grown

The README.md

Guzzle client middleware to profile HTTP requests.

⚠️ This project is up for adoption. Get in touch if you're interested in actively maintaining 3 closely related packages., (*1)

Build Status Latest Stable Version Code Quality Code Coverage Total Downloads License, (*2)

Guzzle Middleware to log made HTTP requests to a timeline for debugging., (*3)

Adapter

A couple of adapters are available:, (*4)

Usage

// First you need a HandlerStack
$stack = GuzzleHttp\HandlerStack::create();

// Create a middleware by wrapping a profiler (eg: DebugBar's profiler):
/** @var DebugBar\DebugBar $debugBar */
$timeline = $debugBar->getCollector('time');
$profiler = new GuzzleHttp\Profiling\DebugBar\Profiler($timeline);
$middleware = new GuzzleHttp\Profiling\Middleware($profiler);

// Add the Middleware to the stack of middlewares.
$stack->unshift($middleware);

// Then you need to add it to the Guzzle HandlerStack
$stack = GuzzleHttp\HandlerStack::create();

$stack->unshift($middleware);

// Create a Guzzle Client with the new HandlerStack:
$client = new GuzzleHttp\Client(['handler' => $stack]);

And you are done! All requests will now be logged to whatever profiler you wrapped., (*5)

Contributing

Feel free to make a pull request. Please try to be as PSR-2 compliant as possible. Fix Code Style quickly by running vendor/bin/php-cs-fixer fix. Give a good description of what is supposed to be added/changed/removed/fixed., (*6)

Testing

To test your code before pushing, run the unit test suite., (*7)

vendor/bin/phpunit

License

MIT, (*8)

The Versions

30/11 2015

dev-master

9999999-dev

A Guzzle middleware that profiles requests made by the client.

  Sources   Download

MIT

The Requires

 

The Development Requires

debug middleware log http guzzle profiler profiling timeline

25/11 2015

1.0.0

1.0.0.0

A Guzzle middleware that profiles requests made by the client.

  Sources   Download

MIT

The Requires

 

The Development Requires

debug middleware log http guzzle profiler profiling timeline