All Projects β†’ nearform β†’ stats

nearform / stats

Licence: Apache-2.0 license
πŸ“Š Collect stats about your node.js process πŸ“Š

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to stats

EventEmitter
Simple EventEmitter with multiple listeners
Stars: ✭ 19 (-34.48%)
Mutual labels:  event-emitter
tiny-typed-emitter
Fully type-checked NodeJS EventEmitter
Stars: ✭ 96 (+231.03%)
Mutual labels:  event-emitter
parallel-event-emitter
Parallel event emitter built on futures-rs
Stars: ✭ 29 (+0%)
Mutual labels:  event-emitter
micro-typed-events
The smallest, most convenient typesafe TS event emitter you'll ever need
Stars: ✭ 39 (+34.48%)
Mutual labels:  event-emitter
Eventemitter2
A nodejs event emitter implementation with namespaces, wildcards, TTL, works in the browser
Stars: ✭ 2,330 (+7934.48%)
Mutual labels:  event-emitter
event-emitter
Simple event emitter for @antvis
Stars: ✭ 14 (-51.72%)
Mutual labels:  event-emitter
spa-bus
πŸ”₯Tools for multilevel components to pass values in any SPA
Stars: ✭ 15 (-48.28%)
Mutual labels:  event-emitter
zeroin
The only Event Emitter you need
Stars: ✭ 19 (-34.48%)
Mutual labels:  event-emitter
react-bus
A global event emitter for react.
Stars: ✭ 34 (+17.24%)
Mutual labels:  event-emitter
events
Tiny type-safe event emitter
Stars: ✭ 25 (-13.79%)
Mutual labels:  event-emitter
typed-emitter
πŸ”© Type-safe event emitter interface for TypeScript
Stars: ✭ 175 (+503.45%)
Mutual labels:  event-emitter
node-await-event-emitter
await events library like EventEmitter
Stars: ✭ 19 (-34.48%)
Mutual labels:  event-emitter
telephone-ts
Telephone-ts: The "Event Emitter-less" TypeScript Event Architecture.
Stars: ✭ 22 (-24.14%)
Mutual labels:  event-emitter
emitting
EventEmitter designed for TypeScript and Promises
Stars: ✭ 37 (+27.59%)
Mutual labels:  event-emitter
emitter-queue
😴 Queue emitter events
Stars: ✭ 16 (-44.83%)
Mutual labels:  event-emitter
event-emitter
Event Emitter module for Nest framework (node.js) πŸ¦‹
Stars: ✭ 102 (+251.72%)
Mutual labels:  event-emitter
common
Common classes used across prooph components
Stars: ✭ 83 (+186.21%)
Mutual labels:  event-emitter
chokidar-socket-emitter
a simple chokidar watcher which emits events to all connected socket.io clients
Stars: ✭ 28 (-3.45%)
Mutual labels:  event-emitter
event
πŸ“† Strictly typed event emitter with asynciterator support
Stars: ✭ 30 (+3.45%)
Mutual labels:  event-emitter
tsee
Typed EventEmitter implemented with tsargs
Stars: ✭ 22 (-24.14%)
Mutual labels:  event-emitter

stats

Build Status

Collect stats about your node.js process.

Intro to the nearform stats tooling

Created with the purpose to make creating visualisations about your process easy. At nearform, we achieve this using the modules stats stats-to-elasticsearch and create-stats-dashboard. This makes it very easy to collect process stats in elasticsearch and visualise them in a dashboard in kibana, similar to that below:

a kibana stats dashboard screenshot

Once your dashboard is setup with create-stats-dashboard, all you should need to do is require the stats-to-elasticsearch module and point it at the dashboard to get cool (and useful) visualisations!

Installation

npm install --save @nearform/stats

Usage

This module exports a function which instantiates an event emitter which emits a single event, stats. This event emitter has two functions which can be used to start and stop probing for statistics, start() and stop(). Listen to the stats event to get useful process statistics.

Example:

const StatsProducer = require('@nearform/stats')
const statsProducer = new StatsProducer()
statsProducer.start()
statsProducer.on('stats', function (stats) {
  // so something with these stats
})

// some time later...
statsProducer.stop()

API

StatsProducer(opts)

Returns an event emitter which emits a stats event containing useful stats.

  • opts: an object which can contain the following properties to set for generating statistics
    • sampleInterval: a number representing the amount of seconds to take a sample when running. Defaults to 5 seconds.
    • eventLoopSampleInterval: the interval at which the eventLoop should be sampled, defaults to 500.
    • eventLoopLimit: the maximum amount of delay that is tolerated before overLimit is detected as true, defaults to 50.
    • tags: an array of user defined strings to tag your stats with

The StatsProducer event emitter which is returned has the following methods.

statsProducer.start() - starts the stats producer listening and producing stats.

statsProducer.stop() - stops producing stats.

Stat object

The stat object which is emitted has the following properties:

  • tags: the array of user defined strings defined in the constructor to tag your stats with
  • id: A uuid generated at start up for this stats producer
  • timestamp: The time the stats were generated
  • process: an object with the following properties extracted from the global process object. See the official node documentation for more information on these properties.
    • cpuUsage: This is a function on the process object which is invoked to fill in the value.
    • memoryUsage: This is a function on the process object which is invoked to fill in the value.
    • uptime: This is a function on the process object which is invoked to fill in the value.
    • title
    • pid
    • release
    • versions
    • argv
    • execArgv
    • execPath
  • system: an object with the following properties extracted from the os module. See the official node documentation for more information on these properties.
    • cpus: This is a function on the os module which is invoked at initialisation to fill in the value. This is not expected to change.
    • uptime: This is a function on the os module which is invoked to fill in the value.
    • freemem: This is a function on the os module which is invoked to fill in the value.
    • loadavg: This is a function on the os module which is invoked to fill in the value.
    • platform
    • arch
  • eventLoop: this is an object which contains the following properties extracted from benchmarking the eventloop.
    • delay: The delay in milliseconds (and fractions) from the expected eventloop run. It might be negative (in older nodes).
    • limit: The maximum amount of delay that is tolerated before overLimit becomes true.
    • overlimit: true if the delay > limit.
  • gcRuns: an array with objects added after every gc run. see here to see the format of the objects added

Useful links

License

Apache 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].