@yunflyjs/yunfly-plugin-memory-check
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@yunflyjs/yunfly-plugin-memory-check

Yunfly memory check plugin. If a certain threshold is exceeded, kill node service.

Usage

  1. install
yarn add @yunflyjs/yunfly-plugin-memory-check
  1. declare plugins in config/config.plugin.ts
/**
 * yunfly plugin
 */
const plugins: {[key:string]: string}[] = [
  {
    name: 'memoryCheck',
    package: '@yunflyjs/yunfly-plugin-memory-check',
    lifeHook: 'beforeStart'
  }
];
// 
export default plugins;
  1. enable plugins in config/config.default.ts
config.memoryCheck = {
  enable: true,
  triggerThreshold: 0.9, // memory usage rate 90%
  intervalTime: 300000, // 5 minute
  cron: '*/20 * * * * *',
}

Package Sidebar

Install

npm i @yunflyjs/yunfly-plugin-memory-check

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

9.3 kB

Total Files

10

Last publish

Collaborators

  • wangweianger