@gasket/plugin-happyfeet
TypeScript icon, indicating that this package has built-in type declarations

7.0.4 • Public • Published

@gasket/plugin-happyfeet

Integrates with happy-feet to add application instance termination when health metrics such as memory usage enter a bad state.

Installation

npm i @gasket/plugin-happyfeet

Update your gasket file plugin configuration:

// gasket.js

+ import pluginHappyfeet from '@gasket/plugin-happyfeet';

export default makeGasket({
  plugins: [
+   pluginHappyFeet
  ]
});

Configuration

You can specify the various happy-feet config options in gasket.js.

// gasket.js
export default makeGasket({
   happyFeet: {
    // https://github.com/asilvas/happy-feet#usage
    escalationSoftLimitMin: 20, // 20s
    escalationSoftLimitMax: 300, // 5min
    uncaughtExceptionSoftLimit: 1,
    uncaughtExceptionHardLimit: void 0,
    rssSoftLimit: 0.9 * 1024 * 1024 * 1024, // ~900MB
    rssHardLimit: 1.8 * 1024 * 1024 * 1024, // ~1.9GB
    logOnUnhappy: true
  }
});

Happy Feet for gasket has no default configuration.

Actions

getHappyFeet

This action is used to configure and get a Happy Feet instance. You can specify the various happy-feet config options in the gasketConfig or pass the config object directly to the action.

gasketConfig example

// gasket.js
export default makeGasket({
   happyFeet: {
    // https://github.com/asilvas/happy-feet#usage
    escalationSoftLimitMin: 20, // 20s
    escalationSoftLimitMax: 300, // 5min
    uncaughtExceptionSoftLimit: 1,
    uncaughtExceptionHardLimit: void 0,
    rssSoftLimit: 0.9 * 1024 * 1024 * 1024, // ~900MB
    rssHardLimit: 1.8 * 1024 * 1024 * 1024, // ~1.9GB
    logOnUnhappy: true
  }
});
const happy = gasket.actions.getHappyFeet();

happyConfig example

const happyConfig =  {
  // https://github.com/asilvas/happy-feet#usage
  escalationSoftLimitMin: 20, // 20s
  escalationSoftLimitMax: 300, // 5min
  uncaughtExceptionSoftLimit: 1,
  uncaughtExceptionHardLimit: void 0,
  rssSoftLimit: 0.9 * 1024 * 1024 * 1024, // ~900MB
  rssHardLimit: 1.8 * 1024 * 1024 * 1024, // ~1.9GB
  logOnUnhappy: true
}
const happy = gasket.actions.getHappyFeet(happyConfig);

License

MIT

Dependents (0)

Package Sidebar

Install

npm i @gasket/plugin-happyfeet

Weekly Downloads

198

Version

7.0.4

License

MIT

Unpacked Size

10.6 kB

Total Files

11

Last publish

Collaborators

  • bbetts
  • rxmarbles
  • ecarlson-godaddy
  • jpina1-godaddy
  • mmason2
  • kinetifex
  • 3rdeden
  • kawikabader