PHPackages                             jaapio/phpbench-blackfire - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. jaapio/phpbench-blackfire

AbandonedArchivedComposer-plugin[Testing &amp; Quality](/categories/testing)

jaapio/phpbench-blackfire
=========================

Blackfire executor for phpbench

21801[1 PRs](https://github.com/jaapio/phpbench-blackfire/pulls)PHP

Since Sep 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jaapio/phpbench-blackfire)[ Packagist](https://packagist.org/packages/jaapio/phpbench-blackfire)[ RSS](/packages/jaapio-phpbench-blackfire/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHPBench Blackfire Extension
============================

[](#phpbench-blackfire-extension)

This repository contains a PHPBench Blackfire extension, which enables you to profile your benchmarks using [Blackfire.io](https://blackfire.io). The extension contains a custom executor and logger. The executor can be used without the logger, the logger cannot be used without the executor.

Please note that the logger is using *Premium/Enterprise* features of blackfire, usage of the logger is optional.

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

[](#installation)

PHPBench requires extensions to be installed via composer since it is using the autoloader to load the extension classes. Besides that this extension is building its autoloader to load additional classes that are used to connect with Blackfire during the execution of your benchmarks. Therefore the only possible installation method is composer.

To install this extension execute.

`composer require phpbench/phpbench jaapio/phpbench-blackfire`

The extension requires the [Blackfire agent](https://blackfire.io/docs/up-and-running/installation) to instrument the executed benchmarks like every other implementation that uses blackfire.io.

Configuration
-------------

[](#configuration)

To enable the extension you add the extension to your PHPBench config. The extension will pick the settings from the PHPBench config as shown in the example below. `config` and `env` are both optional.

`env` can be omitted when your Blackfire account doesn't have an [environment](https://blackfire.io/docs/reference-guide/environments).

`config` is a path to a Blackfire ini file containing the client id and client token to authenticate with Blackfire api. When `config` setting is omitted the users home directory is consulted for a config file. The last fallback are the environment variables `BLACKFIRE_CLIENT_ID`, `BLACKFIRE_CLIENT_TOKEN` and `BLACKFIRE_ENDPOINT`

```
{
  "bootstrap": "vendor/autoload.php",
  "path": "tests/benchmark",
  "extensions": [
    "Jaapio\\Blackfire\\Extension"
  ],
  "blackfire" : {
    "config": 'path/to/blackfire.ini',
    "env": ""
  }
}
```

Execution
---------

[](#execution)

To run full-featured build you can execute the command below. `phpbench run -l blackfire --executor=blackfire --tag="Build_name"`

### Refs

[](#refs)

PHPBench allows you to set refs on each benchmark. The refs are translated into steps on a profile report and visible in Blackfire.

### Assertions *(Premium/Enterprise)*

[](#assertions-premiumenterprise)

Blackfire has options to add assertions. This extension supports these assertions in the executor annotation that can be set above your benchmark. The expressions are not parsed by the extension but just passed as-is. Please consult the Blackfire documentation for more information about assertions.

```
class YourBench
{

    /**
     * @Executor(
     *     "blackfire",
     *     assertions={
     *      {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
     *      "main.wall_time < 1ms"
     *      }
     * )
     */
    public function benchMd5() : void
    {
        md5('test');
    }

```

### Iterations &amp; Variants

[](#iterations--variants)

Each execution of a benchmark, so iterations and variants included are sent as separate profiles to Blackfire. Be aware that the number of profiles created by this extension can be huge when using it in the wrong way. I do not recommend using large amounts of iterations in combination with a lot of benchmarks. It will most likely flood your Blackfire account.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/471baf346b526fa9e1259ee3d577b1dd72fbb45337b495d5475f87ba063490cb?d=identicon)[jaapio](/maintainers/jaapio)

---

Top Contributors

[![jaapio](https://avatars.githubusercontent.com/u/1060433?v=4)](https://github.com/jaapio "jaapio (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/jaapio-phpbench-blackfire/health.svg)

```
[![Health](https://phpackages.com/badges/jaapio-phpbench-blackfire/health.svg)](https://phpackages.com/packages/jaapio-phpbench-blackfire)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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