violin

0.1.20 • Public • Published

violin

Node instrumentation with pre-built node binaries.

Internally packages and runs heapdump so the consumer does not need node-gyp working on their machine.

Build Status codecov

NPM

Install

npm i -S violin

Usage

import violin from 'violin'
                                        /** Create a memory dump on startup */
const opts =  { instrument: { memory: { startup: true
                                        /** Create a memory dump every 4 hours */
                                      , frequency: 14400000
                                        /** Create a memory dump whenever any of these process.on events occur */
                                      , events: [ 'uncaughtException' ]
                                      }
                            }
              }
 
const { instrument } = violin(opts)
 
/** Start instrumenting memory per above options */
instrument()

TEST

Unit tests output for current release:

TOC

lib

#default

should have default function export.

return should.exist(lib.default);

violin

should be a function.

return violin.should.be.a('function');

#instrument

should return an instrument object.

return violin().should.be.an('object').that.has.property('instrument');

should not throw for valid opts.

return function () {
  return violin(opts).instrument();
}.should.not.throw();

Package Sidebar

Install

npm i violin

Weekly Downloads

0

Version

0.1.20

License

MIT

Last publish

Collaborators

  • cchamberlain