A panel for Tracy, that traces PSR HTTP messages travelling between your PHP backend and other HTTP servers.
PHP 5.6 or 7.0
Install with composer:
composer require slepic/psr-http-message-tracy-panel
Basicaly you just need to:
create the bar panel using the factory
Slepic\Tracy\Bar\PsrHttpMessagePanel\Factoryand register it with
to create the panel instance you will need to feed it with an iterator of instances of
simple implementation of such iterator is included in the
slepic/http-transferpackage and is named
Slepic\Psr\Http\Transfer\Log\ArrayStorage, which simply stores transfer log in a PHP array.
And lastly, you need to feed the storage with the transfer logs using your http client.
HistoryObserverclass which allows to easily collect the logs into your storage using your favourite http client.
slepic/http-transfer-observer-consumerfor a list of adapters to see if there is one for your http client.
For usage see this example!
And of course it is super simple to register the panel in Nette's DI as described here.
- Create another package to provide integration with PSR HTTP Client
- Removed class PsrHttpMessagePanel
- Factory is now used to create the panel, using TemplatedBarPanel class from slepic/templated-tracy-bar-panel package as the target implementation.
- Slepic\Psr namespace is now replaced by package slepic/http-transfer
- support for guzzle moved to slepic/guzzle-http-observing-middleware
- BC break: totally everythig
- Added support for transfer duration
- Improved panel layout
Removed class PsrHttpMessagePanel
Now using Factory to create TemplatedBarPanel instance.
Replaced namespace Slepic\Psr by package slepic/http-transfer
Replace guzzle support by package slepic/guzzle-http-observing-middleware
Transfer duration tracking support.