warzone
v0.1.0
Published
Local chaos engineering toolkit to simulate traffic patterns and service failures
Downloads
107
Readme
warzone
Local chaos engineering toolkit to simulate traffic patterns and service failures
Features
- Generate controlled traffic patterns (HTTP, gRPC, TCP) against local services
- Inject failures: latency, packet loss, error responses, and instance shutdowns
- Scenario scripting and scheduling for reproducible test runs
- Integrations with Docker and Kubernetes for targeting containers and pods
Install
npm install warzone
Quick Start
Install the package and use the API to define a simple scenario that sends traffic and injects a latency fault:
const Warzone = require('warzone');
(async () => {
const wz = new Warzone();
// register targets
wz.addTarget('users', { type: 'http', url: 'http://localhost:3000' });
// define traffic pattern: 50 requests/sec for 30s
wz.addTraffic('users', {
rps: 50,
duration: 30_000,
method: 'POST',
path: '/api/login',
body: { test: true }
});
// schedule a fault: add 200ms latency after 10s for 20s
wz.injectFault('users', {
type: 'latency',
delayMs: 200,
startAfterMs: 10_000,
durationMs: 20_000
});
// run the scenario
await wz.run();
// collect results
const report = wz.report();
console.log('Run complete', report);
await wz.close();
})();See the API docs for advanced options (kubernetes targets, custom fault plugins, and metrics exporters).
License
MIT
