npm.io
0.10.1 • Published 4 years ago

@dazn/chaos-squirrel-attack-disk-space

Licence
MIT
Version
0.10.1
Deps
0
Size
8 kB
Vulns
0
Weekly
0
Stars
16
DeprecatedThis package is deprecated

@dazn/chaos-squirrel-attack-disk-space

Consume lots of disk space. Spawns a dd process, so this is unlikely to work on non-unix systems.

Note that AWS Lambda functions have 512 MB disk space available.

Usage

import DiskSpaceAttack from '@dazn/chaos-squirrel-attack-disk-space';
const createDiskSpaceAttack = DiskSpaceAttack.configure({
  // 2gb
  size: 2000000000,
});
const diskSpaceAttack = createDiskSpaceAttack();

// Start and stop methods are async for this attack.
// You should await the results to ensure the file is fully created + removed
await diskSpaceAttack.start();
// a 2gb file will be created
await diskSpaceAttack.stop(); // deletes the file