plotly-njstrace
v0.0.3
Published
output njstrace logs to plotly graphs
Downloads
1
Readme
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.
PlotlyFormatter(username, apiKey, graphName, interval, layout)
username
is your Plotly usernameapiKey
is your Plotly api keygraphName
is your desired graph nameinterval
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