Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noderaider/violin

Instrumentation with pre-built node binaries.
https://github.com/noderaider/violin

heap instrumentation violin

Last synced: 2 days ago
JSON representation

Instrumentation with pre-built node binaries.

Awesome Lists containing this project

README

        

# violin

**Node instrumentation with pre-built node binaries.**

**Internally packages and runs [heapdump](https://npmjs.com/packages/heapdump) so the consumer does not need node-gyp working on their machine.**

[![Build Status](https://travis-ci.org/noderaider/violin.svg?branch=master)](https://travis-ci.org/noderaider/violin)
[![codecov](https://codecov.io/gh/noderaider/violin/branch/master/graph/badge.svg)](https://codecov.io/gh/noderaider/violin)

[![NPM](https://nodei.co/npm/violin.png?stars=true&downloads=true)](https://nodei.co/npm/violin/)

## Install

`npm i -S violin`

## Usage

```js
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](#lib)
- [#default](#lib-default)
- [violin](#lib-violin)
- [#instrument](#lib-violin-instrument)



# lib

## #default
should have default function export.

```js
return should.exist(lib.default);
```


## violin
should be a function.

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


### #instrument
should return an instrument object.

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

should not throw for valid opts.

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