PHP code example of chaos-php / chaos-monkey
1. Go to this page and download the library: Download chaos-php/chaos-monkey library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
chaos-php / chaos-monkey example snippets
$settings = new Settings();
$chaosMonkey = new ChaosMonkey([
new LatencyAssault($settings),
new MemoryAssault($settings),
new ExceptionAssault($settings),
new KillAppAssault($settings)
], $settings);
$settings->setExceptionActive(true);
$settings->setExceptionClass(\RuntimeException::class);
$settings->setProbability(100);
$settings->setEnabled(true);
$chaosMonkey->call();
bash
composer