PHPackages                             bmancone/guzzle-stopwatch-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. [HTTP &amp; Networking](/categories/http)
4. /
5. bmancone/guzzle-stopwatch-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bmancone/guzzle-stopwatch-middleware
====================================

Stopwatch Middleware for Guzzle.

v1.0.2(3y ago)4109.8k↓37.5%32MITPHPPHP &gt;=7.2

Since Jun 15Pushed 3y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (4)Versions (7)Used By (2)

Guzzle middleware to time requests
==================================

[](#guzzle-middleware-to-time-requests)

[![Author](https://camo.githubusercontent.com/ffd2eacdf35b87edc62851cdec48d51ca32b9f2f2eec2c9645afbf1f10835c29/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40626d616e636f6e652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/bmancone)[![Latest Version](https://camo.githubusercontent.com/b3f84ea043025e361cdc479118869ee11e19f057a3e86b337be064744bfde379/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626d616e636f6e652f67757a7a6c652d73746f7077617463682d6d6964646c65776172652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bmancone/guzzle-stopwatch-middleware)[![Build Status](https://camo.githubusercontent.com/36382d72e2098a0bc98eb5bcc1803ff5308e04ffb707faf17f2ad4854b9a2e58/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f626d616e636f6e652f67757a7a6c652d73746f7077617463682d6d6964646c65776172652e7376673f7374796c653d666c61742d737175617265266272616e63683d6d6173746572)](https://travis-ci.org/bmancone/guzzle-stopwatch-middleware)

Installation
------------

[](#installation)

```
composer require bmancone/guzzle-stopwatch-middleware
```

Usage
-----

[](#usage)

Requires an instance of `Symfony\Component\Stopwatch\Stopwatch`.

```
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request;

use Symfony\Component\Stopwatch\Stopwatch;

Use Leadz\GuzzleHttp\Stopwatch\StopwatchMiddleware;

// Create the default HandlerStack
$stack = HandlerStack::create();

// Create the middleware
$middleware = new StopwatchMiddleware(new Stopwatch());

// Push the Middleware to the stack
$stack->push($middleware);

// Create the client
$client = new Client([
    'handler' => $stack
]);

// Send the request
$request = new Request('GET', 'https://en.wikipedia.org/wiki/Main_Page');
$response = $client->send($request);

// Get the duration of the request
printf('Request to [%s] took [%dms]', (string)$request->getUri(), $response->getHeaderLine('X-Duration'));
```

Symfony Profiler
----------------

[](#symfony-profiler)

If you are using Symfony, simply inject `debug.stopwatch` (or use autowiring), this will add events to the profiler timeline.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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

Every ~673 days

Total

5

Last Release

1297d ago

Major Versions

v0.0.2 → v1.0.02017-09-01

PHP version history (2 changes)v0.0.1PHP &gt;=5.5

v1.0.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7479ea5fdde4f39a24387bcaa412c66e2d814d7bd434ef8c3f8df622de9000ec?d=identicon)[bmancone](/maintainers/bmancone)

---

Top Contributors

[![bmancone](https://avatars.githubusercontent.com/u/2864622?v=4)](https://github.com/bmancone "bmancone (5 commits)")[![shieldo](https://avatars.githubusercontent.com/u/97280?v=4)](https://github.com/shieldo "shieldo (3 commits)")[![hectorj](https://avatars.githubusercontent.com/u/2427959?v=4)](https://github.com/hectorj "hectorj (1 commits)")

---

Tags

symfonyGuzzletimelinestopwatch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bmancone-guzzle-stopwatch-middleware/health.svg)

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

###  Alternatives

[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[graham-campbell/guzzle-factory

Provides A Simple Guzzle Factory With Good Defaults

916.4M49](/packages/graham-campbell-guzzle-factory)[auxmoney/opentracing-bundle-core

Symfony Opentracing bundle to easily enable distributed tracing

25904.4k9](/packages/auxmoney-opentracing-bundle-core)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[facile-it/crossbar-http-publisher-bundle

This bundle allows to submit PubSub events via HTTP/POST requests to a Crossbar HTTP Publisher.

1114.4k](/packages/facile-it-crossbar-http-publisher-bundle)

PHPackages © 2026

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