PHPackages                             darraghb/bottler - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. darraghb/bottler

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

darraghb/bottler
================

A package to find bottlenecks in your php project.

v1.0.2(3y ago)014MITPHP

Since Feb 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/DarraghB/bottler)[ Packagist](https://packagist.org/packages/darraghb/bottler)[ RSS](/packages/darraghb-bottler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Bottler 8-)
===========

[](#bottler-8-)

### A package to time test the performance of functions

[](#a-package-to-time-test-the-performance-of-functions)

Usage
-----

[](#usage)

```
$bottler->staticPerformance('methodName', 'arg1', 'arg2');
```

### Setup

[](#setup)

```
composer require darraghb/bottler
```

Initialize bottler
------------------

[](#initialize-bottler)

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

use Darraghb\Bottler\Bottler;

#Initialize bottler and specify the unit of measurement (seconds|nanoseconds)

$bottler = new Bottler(
	['unit' => 'seconds',
	'fileName' => __FILE__]);
```

Run a test on a static method
-----------------------------

[](#run-a-test-on-a-static-method)

```
$bottler->staticPerformance('mySlowTest', 20, 5000);

function mySlowTest($start= false, $loop = false)
{
	$ans = '';
	for ($i=0; $i < $loop; $i++) {
		$ans = $i;
	}
}
```

Run a test on a method within a class
-------------------------------------

[](#run-a-test-on-a-method-within-a-class)

### make sure to include $this in the initializer

[](#make-sure-to-include-this-in-the-initializer)

```
$bottler = new Bottler(
	['unit' => 'seconds',
	'fileName' => __FILE__,
	'this' => $this]);

$bottler->performance('methodName', 20, 5000);
```

Output
------

[](#output)

### The package will output the function name and the number of seconds it takes to run.

[](#the-package-will-output-the-function-name-and-the-number-of-seconds-it-takes-to-run)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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 ~4 days

Total

3

Last Release

1178d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e870fcc0a6541881048c60bd5e6a21869cebf491ce179bd4a3c8b597f580f21?d=identicon)[darraghb](/maintainers/darraghb)

### Embed Badge

![Health badge](/badges/darraghb-bottler/health.svg)

```
[![Health](https://phpackages.com/badges/darraghb-bottler/health.svg)](https://phpackages.com/packages/darraghb-bottler)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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