PHPackages                             mtolhuys/laravel-request-benchmark - 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. mtolhuys/laravel-request-benchmark

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

mtolhuys/laravel-request-benchmark
==================================

Configurable middleware measuring your request's time and memory usage

1.1.1(6y ago)131MITPHPPHP ^7.0

Since Aug 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mtolhuys/laravel-request-benchmark)[ Packagist](https://packagist.org/packages/mtolhuys/laravel-request-benchmark)[ Docs](https://github.com/mtolhuys/laravel-request-benchmark)[ RSS](/packages/mtolhuys-laravel-request-benchmark/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (6)Used By (0)

Easily benchmark you're requests
================================

[](#easily-benchmark-youre-requests)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0064d08484acc7a8a735eb5753b1ce4b4a8aba45823242eca54fcc9ca44eb700/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d746f6c687579732f6c61726176656c2d726571756573742d62656e63686d61726b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mtolhuys/laravel-request-benchmark)[![Build Status](https://camo.githubusercontent.com/e45663f6f5787a34f8f84b4f503217091a76e81955dfd3607bdfe5e92b706e37/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d746f6c687579732f6c61726176656c2d726571756573742d62656e63686d61726b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mtolhuys/laravel-request-benchmark)[![Quality Score](https://camo.githubusercontent.com/e63ae686f313032c1b409d7fb5721cb5459aa84faae669a1b73d3bfb1dd6667e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d746f6c687579732f6c61726176656c2d726571756573742d62656e63686d61726b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mtolhuys/laravel-request-benchmark)[![Total Downloads](https://camo.githubusercontent.com/60c444128f9306e38610074eabc3dd30bbc5626a82c87613a2ff920f996b6c3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d746f6c687579732f6c61726176656c2d726571756573742d62656e63686d61726b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mtolhuys/laravel-request-benchmark)

This package comes with a benchmark middleware which, if included, will measure your requests time and memory usage.

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

[](#installation)

You can install the package via composer:

```
composer require mtolhuys/laravel-request-benchmark
```

Usage
-----

[](#usage)

Add the `'benchmark'` middleware to the routes you want to measure f.e.:

```
Route::group(['middleware' => ['foo', 'bar', 'benchmark']], function() {
    // benchmarked routes
});

// Or

Route::get('/', 'IndexController@index')->middleware('benchmark');
```

Out of the box this will create debug log entries f.e.:

```
[yyyy-mm-dd hh:mm:ss] local.DEBUG: request-benchmark: GET[http://localhost]
Time: 1.05ms
Pre memory usage 3169Kb
Post memory usage 3296Kb (127Kb)

```

As well as a overview page on route `/request-benchmark` containing a table showing the results stored in `request-benchmark.json` file.

This behavior is configurable with the included request-benchmark config file. Run `php artisan vendor:publish --provider="Mtolhuys\LaravelRequestBenchmark\LaravelRequestBenchmarkServiceProvider"` if you don't see it in your config/ folder.

```
return [
    'enabled' => true, // set to false to globally stop benchmark
    'log' => true, // set to false to stop creating log entries
    'storage_path' => null, // if specified it will create a request-benchmark.json containing all data
];
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Maarten Tolhuijs](https://github.com/mtolhuys)
- [All Contributors](../../contributors)
- [Laravel Package Boilerplate](https://laravelpackageboilerplate.com)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Every ~0 days

Total

5

Last Release

2473d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f86a601f247298c0f4beb73d0fd47aca41551ad230c4a0ff9cdab56ddc0d55f?d=identicon)[mtolhuijs](/maintainers/mtolhuijs)

---

Top Contributors

[![mtolhuys](https://avatars.githubusercontent.com/u/10849136?v=4)](https://github.com/mtolhuys "mtolhuys (6 commits)")

---

Tags

mtolhuyslaravel-request-benchmark

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mtolhuys-laravel-request-benchmark/health.svg)

```
[![Health](https://phpackages.com/badges/mtolhuys-laravel-request-benchmark/health.svg)](https://phpackages.com/packages/mtolhuys-laravel-request-benchmark)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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