plotly-njstrace

0.0.3 • Public • Published

njstrace + plotly

quick and dirty visualization of node.js function tracing.

Plugin (formatter) for njstrace

This formatter will output a bar chart with each bar representing the time spent in each function. Functions are labelled with the file they were called from.

Usage

var PlotlyFormatter = require('plotly-njstrace');
 
var traceOptions = { 
    formatter: new PlotlyFormatter('username', 'apiKey', 'graph name', 5000) 
};
 
// Call inject and use plotly formatter in opts
var njstrace = require('njstrace').inject(traceOptions);
 
var Brou = require('./examples/brouhaha.js');
var brou = new Brou();
 
// Do some stuff on "b"
setInterval(function run(){
    brou.haha(1000);
    brou.hehe(10000);
    brou.hoho(1000);
    brou.teehee(1000000);
    brou.hahaha(10000);
    brou.hihihi(1000);
}, 1000);

Outputs

Click here for the interactive graph. Output

PlotlyFormatter(username, apiKey, graphName, interval, layout)

  • username is your Plotly username
  • apiKey is your Plotly api key
  • graphName is your desired graph name
  • interval is the frequency to post your data to plotly (default 5s)
  • layout optional is a Plotly layout object (default used if none specified)

Installation

npm install njstrace-plotly-formatter

Dependents (0)

Package Sidebar

Install

npm i plotly-njstrace

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • alexander-daniel