Runs Apache Benchmark to measure speed of application.
- PHP 7.3 and higher
- Apache Bench
- Git repository (for find slow commit feature)
composer require janmikes/slowpoker
- Clears cache
- Optimizes composer autoloader
- Cleans changes in git repository when done
bin/test-speed [options]
Options:
--maxSpeed=MAXSPEED Max allowed response time, if not met (is higher) will exit as error
--requests=REQUESTS Number of HTTP requests made [default: 2000]
--url=URL URL to test speed with (glami.cz will be replaced with your working copy) [default: "http://www.glami.cz/damske-baleriny/?original"]
--cacheDir=CACHEDIR Relative path to cache directory [default: "temp/cache"]
This tool is great when used in git bisect, to detect which commit slowed the application.
Run this in your working repository (working copy):
git bisect start <BAD> <GOOD>
git bisect run <TESTER>
Minimum example, when I know current commit is slow (80ms) and commit 647b912
was fast (72ms) and I want to find out which commit made it slower >73ms:
git bisect start HEAD 647b912
git bisect run /some-path/bin/speed-test --maxSpeed=73
This package was sponsored by Glami, thank you!