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(9y ago)157.9k↓65.1%53MITPHP

Since Jun 9Pushed 9y 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 2d 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 79% 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

3312d 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

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M23](/packages/spatie-flare-client-php)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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