@speedup/sysinfo-health
v1.0.7
Published
Shows current status of the service which can be used in health-check solutions
Downloads
2
Maintainers
Readme
SpeedUP Health service
This module provides some information about your service health.
Installation
# NPM
npm i @speedup/sysinfo-health --save
# Yarn
yarn install @speedup/sysinfo-health
Parts
This module consists of 3 main parts.
- HealthService (which is responsible for retrieving health information from the requested providers).
- InfoProvider (which is responsible for providing health information)
- WebFramework (which is responsible for integrating with the web frameworks).
Usage
const serviceHealth = require('@speedup/sysinfo-health');
const infoProvider = new serviceHealth.InfoProvider({
loadDefaultProviders: true
});
const healthProvider = new serviceHealth.HealthProvider(config, infoProvider);
// inside your async function, try
const health = await healthProvider.retrieve();
// returns an object that contains the health information
// you can return only the information about specific parts of the hardware/software
// by providing the list of modules
// built-in info services: CPU, memory, OS, path, uptime, user
const health = await healthProvider.retrieve(['CPU', 'memoy']);
And you're good to go!
License
MIT