PHPBench Reports¶
The Reports extension wraps a given storage driver (XML by default) and additionally sends the results over HTTP to a phpbench-reports server.
PHPBench reports is a web application which indexes the results for multiple projects in elastic search and provides visualization.
Installation¶
Enable the phpbench-reports extension and set your storage driver to reports
:
{
"extensions": {
"PhpBench\\Extensions\\Reports\\ReportsExtension"
}
}
Configuration¶
Set the storage driver to reports
, you will need to configure both the URL
where phpbench-reports can be found, and the API key (which can be
requested from the PHPBench reports server):
{
"storage": 'reports',
"storage.reports.url" => "https://reports.phpbench.org",
"storage.reports.api_key" => "<api-key>"
}
Note
The API key can also be provided via. an environment variable, see “travis integration” below.
By default it will wrap the XML storage driver, this can be changed as follows:
{
'storage.reports.inner_driver' => 'blah'
}
Travis Integration¶
Warning
Travis is heavily-loaded and quite unsuitable for benchmarking purposes, but it’s potentially interesting.
You can use the travis CLI application to encrypt the API key env var:
$ travis encrypt REPORTS_API_KEY=<your API key> --report=your/repo
You can then add the encrypted env var to .travis.yml as follows:
env:
global:
secure: "<encrypted key here>"
Configure PHPBench to run as normal with the –store option:
script:
- ./vendor/bin/phpbench run --store