PHPackages                             bentools/guzzle-duration-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. bentools/guzzle-duration-middleware

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

bentools/guzzle-duration-middleware
===================================

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

1.0(8y ago)157.3k↓50%53MITPHP

Since Jun 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bpolaszek/guzzle-duration-middleware)[ Packagist](https://packagist.org/packages/bentools/guzzle-duration-middleware)[ RSS](/packages/bentools-guzzle-duration-middleware/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (3)

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

Usage
-----

[](#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
------------

[](#installation)

```
composer require bentools/guzzle-duration-middleware

```

Tests
-----

[](#tests)

```
./vendor/bin/phpunit

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3266d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acdd1a8ee0e657ddd06cf11f98a32100ef7121afb8aa270a5b295f5c29c038b3?d=identicon)[bpolaszek](/maintainers/bpolaszek)

---

Top Contributors

[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bentools-guzzle-duration-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/bentools-guzzle-duration-middleware/health.svg)](https://phpackages.com/packages/bentools-guzzle-duration-middleware)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2081.1M2](/packages/marvinlabs-laravel-discord-logger)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299549.3k1](/packages/larabug-larabug)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
