https://github.com/chaos-php/chaos-monkey
Chaos Monkey is a resiliency tool that helps PHP applications tolerate random failures.
https://github.com/chaos-php/chaos-monkey
chaos-engineering chaos-monkey hacktoberfest php quality-assurance testing
Last synced: 5 months ago
JSON representation
Chaos Monkey is a resiliency tool that helps PHP applications tolerate random failures.
- Host: GitHub
- URL: https://github.com/chaos-php/chaos-monkey
- Owner: chaos-php
- License: mit
- Created: 2021-01-23T07:56:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-28T08:12:39.000Z (10 months ago)
- Last Synced: 2025-11-12T03:40:32.582Z (7 months ago)
- Topics: chaos-engineering, chaos-monkey, hacktoberfest, php, quality-assurance, testing
- Language: PHP
- Homepage:
- Size: 110 KB
- Stars: 28
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChaosMonkey 🐒 for PHP
[](https://php.net/)
[](https://github.com/chaos-php/chaos-monkey/actions/workflows/build.yml)
[](https://packagist.org/packages/chaos-php/chaos-monkey)

Chaos Monkey for PHP applications. Try to attack your running PHP App.
## Assaults
- **Latency Assault** - adds a delay randomly from the range (min and max)
- **Exception Assault** - throws given exception class
- **Memory Assault** - fill memory until target fraction (95% for example)
- **Kill Assault** - no mercy, plain `exit()`
## How to use
The best experience you can get is using ready-made integrations:
- Symfony: [ChaosMonkeySymfonyBundle](https://github.com/chaos-php/chaos-monkey-symfony-bundle)
- Laravel: [ChaosMonkeyLaravelPackage](https://github.com/chaos-php/chaos-monkey-laravel-package) (in progress)
If your framework is missing, open an issue or use this package manually:
1. Install with composer:
```bash
composer require chaos-php/chaos-monkey
```
2. Create `ChaosMonkey` object
```php
$settings = new Settings();
$chaosMonkey = new ChaosMonkey([
new LatencyAssault($settings),
new MemoryAssault($settings),
new ExceptionAssault($settings),
new KillAppAssault($settings)
], $settings);
```
3. Configure settings and trigger chaos monkey in the working place of the application:
```php
$settings->setExceptionActive(true);
$settings->setExceptionClass(\RuntimeException::class);
$settings->setProbability(100);
$settings->setEnabled(true);
$chaosMonkey->call();
```
4. Watch your app plunge into chaos 🙈🙊🙉 😈
## License
ChaosMonkey is released under the MIT Licence. See the bundled LICENSE file for details.
## Author
[Arkadiusz Kondas](https://twitter.com/ArkadiuszKondas)