
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@dazn/chaos-squirrel-runner
Advanced tools
Run chaos attacks!
import ChaosRunner from '@dazn/chaos-squirrel-runner';
import CPUAttack from '@dazn/chaos-squirrel-attack-cpu';
const createRunner = ChaosRunner.configure({
probability: 1,
possibleAttacks: [
{
weight: 2, // run twice as often as the default
createAttack: CPUAttack.configure({ allowLoopEvery: 10 }),
},
{
// weight: 1, // default value
createAttack: () => {
// Use a class for Attacks, as the Runner will take the class name as the attack name
class CustomAttack {
start() {
// do a custom attack!
}
stop() {
// stop the attack
}
}
return new CustomAttack();
},
},
],
// OPTIONAL: define a custom logger, defaults to console methods
logger: (level, message, details) => console[level](message, details),
});
// a new instance of the runner should be created for each possible chaos run
const runner = createRunner();
// start the chaos!
runner.start();
// do things
// stop the chaos
runner.stop();
| Parameter | Type | Default | Description |
|---|---|---|---|
probability | Number | 1 | A "global" probability range between 0-1. Defaults to 1 which is 100% probability. |
possibleAttacks | Array | - | An array of objects of possible attacks that could be initiated |
logger | Function | (level, ...args) => console[level](...args) | A logger function which is called for significant actions/decisions, such as starting an attack. Set to a no-op (() => {}) to disable logging |
| Parameter | Type | Default | Description |
|---|---|---|---|
weight | Number | 1 | Sets the weighting of an attack vs the other attacks. Default = 1, set to 0 to disable this attack. |
createAttack | Function | - | Function which returns an attack class exposing a start and stop method. |
The likelihood of running a given attack is the runner.probability * possibleAttack.weight / SUM(possibleAttacks.weight).
For example, if runner.probability is set to 0.5 and there are two possible attacks:
13The probability of any each attack running will be
0.5 * 1 / 4 = 0.1250.5 * 3 / 4 = 0.375runner.probability = 0.50.10.1 (2021-07-20)
Note: Version bump only for package @dazn/chaos-squirrel
FAQs
Run chaos experiments in your application
We found that @dazn/chaos-squirrel-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.