@speedup/sysinfo-health
Shows current status of the service which can be used in health-check solutions
Last updated 4 months ago by dmanavi .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @speedup/sysinfo-health 
SYNC missed versions from official npm registry.

SpeedUP Health service

This module provides some information about your service health.

NPM version NPM downloads

Installation


# NPM
npm i @speedup/sysinfo-health --save

# Yarn
yarn install @speedup/sysinfo-health

Parts

This module consists of 3 main parts.

  1. HealthService (which is responsible for retrieving health information from the requested providers).
  2. InfoProvider (which is responsible for providing health information)
  3. 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

Current Tags

  • 1.0.7                                ...           latest (4 months ago)

2 Versions

  • 1.0.7                                ...           4 months ago
  • 1.0.6                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (17)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |