rx2

1.0.3 • Public • Published

RX2

Report Events, Metrics, Issues, Actions to PM2 and PM2.io.

const rx2 = require('rx2')

// Event
rx2.event('eat', { food: 'poke' })

// Metric
rx2.metric({
  name: 'calories',
  val: () => {
    return 20
  }
})

rx2.metric('burnt calories', () => {
  return 30
})

let exC = rx2.metric('excess calories')
exC.set(40)

// return true
rx2.metricExists('burnt calories')

// Issue
rx2.issue(new Error('overweight')
rx2.issue('overweight')

// Action
rx2.action('lift weights', (cb) => {
  cb({ success: true })
})
$ pm2 start app.js
# Inspect primitive reported
$ pm2 show app

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.31latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.31
1.0.20
1.0.10

Package Sidebar

Install

npm i rx2

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

27 kB

Total Files

23

Last publish

Collaborators

  • tknew