1.0.6 • Published 3 years ago

lisk-plugin-health v1.0.6

Weekly downloads
-
License
GPL-3.0-or-later
Repository
-
Last release
3 years ago

Lisk Plugin Health

npm

Installation

npm install lisk-plugin-health
# or
yarn add lisk-plugin-health

Getting started

// src/application/index.js

import { HealthPlugin } from 'lisk-plugin-health';

app.registerPlugin(HealthPlugin);

Usage

To check the health of the app, just run.

// Use the params as configured, see below
const isHealthy = await this._client.invoke('health:isHealthy');
// or set a custom delay (default is 12000)
const isHealthy = await this._client.invoke('health:isHealthy', {
  delayUntilUnhealthy: 15000,
});

It will return 0 if the app is healthy, 1 if there is an issue

Configuration

The app is considered healthy if it registered a block recently. You can configure the delay before the app is considered unhealthy. The unit is milliseconds.

// src/application/index.js

const appConfig = utils.objects.mergeDeep({}, configDevnet, {
  plugins:  {
    health: {
      delayUntilUnhealthy: 15000 // default 12000
    }
  },
});

const app = Application.defaultApplication(genesisBlockDevnet, appConfig); 
1.0.2

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago