Benchmarker framework written in PHP, prefork worker.
punchmachine uses composer for installing dependencies.
composer install
And requires PHP pcntl
and posix
functions.
You have to compile the CLI version of PHP with --enable-pcntl
configuration option when compiling PHP to enable Process Control support.
(posix
is enabled by default. Do not disable POSIX-like functions with --disable-posix
)
Autoloader loads benchmarker classes from ./benchmarker/ClassName.php
.
Benchmarker class must extend Punchmachine\Benchmarker\Benchmarker
class.
class FooBenchmarker extends Benchmarker {
}
punchmachine requires ini-like configration file.
The ini file have to contains global
section, and optional by benchmarker.
[global]
benchmarker = "DummyBenchmarker"
servers[] = '127.0.0.1'
benchmark_timeout = 10
failure_limit = 50
initializer = ""
[benchmarker.processes]
sleep_call = 1
- global.benchmarker
- Benchmarker name.
punchmachine
's main process loads this class and callrun()
method.
- Benchmarker name.
- global.servers
- List of target servers. It depends on benchmarker.
- global.benchmark_timeout
- Main process timeout
- global.failure_limit
- Failure limit. When failure counts reaches, abort benchmark processes.
- global.initializer
- Call initializer method before benchmarker processes.
- If empty, skip initializer process.
- benchmarker.processes
- worker process number
- Like "
Benchmarker->method
\ = NUM"
./bin/punchmachine.php configration.ini
- Fork it ( https://github.com/t-cyrill/punchmachine/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request