2017 © Pedro Peláez
 

library guzzle-duration-middleware

A GuzzleHTTP Middleware that adds a X-Request-Duration header to all responses to monitor response times.

image

bentools/guzzle-duration-middleware

A GuzzleHTTP Middleware that adds a X-Request-Duration header to all responses to monitor response times.

  • Friday, June 9, 2017
  • by bpolaszek
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4,615 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 81 % Grown

The README.md

This package is a middleware for GuzzleHttp 6+ that helps you monitor the time between requests and responses., (*1)

Usage

require_once __DIR__ . '/vendor/autoload.php';

use BenTools\GuzzleHttp\Middleware\DurationHeaderMiddleware;
use GuzzleHttp\Client;

$client = new Client();
$middleware = new DurationHeaderMiddleware($headerName = 'X-Request-Duration'); // header name is optional, this is the default value
$client->getConfig('handler')->push($middleware);

$response = $client->get('http://httpbin.org/delay/1');
var_dump((float) $response->getHeaderLine('X-Request-Duration')); // 1.177

Installation

composer require bentools/guzzle-duration-middleware

Tests

./vendor/bin/phpunit

The Versions

09/06 2017

dev-master

9999999-dev

A GuzzleHTTP Middleware that adds a X-Request-Duration header to all responses to monitor response times.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar bpolaszek

09/06 2017

1.0

1.0.0.0

A GuzzleHTTP Middleware that adds a X-Request-Duration header to all responses to monitor response times.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar bpolaszek