1.0.0 • Published 9 years ago

memory-tripwire v1.0.0

Weekly downloads
88
License
MIT
Repository
github
Last release
9 years ago

memory-tripwire

NPM version build status Test coverage David deps node version Gittip

suicide when memory over the limit

Installation

$ npm install memory-tripwire

Usage

var tripwire = Tripwire({
  warning: '20mb',
  critical: '40mb',
  interval: '1s',
  cycle: 3,
  exitTime: '5s',
  disconnectTime: '3s'
});

tripwire.start();
tripwire.on('bomb', function () {
  console.log('oops');
});

Options

  • warning - warning memory limit, will be killed after observation
  • critical - critical memory limit, will be killed at once if memory is critical
  • interval - memory check interval
  • cycle - max warning continuously cycle, or will be killed
  • disconnectTime - will disconnect after disconnctTime
  • exitTime - will exit after exitTime
  • exitCode - will exit with exitCode

Examples

License

MIT