timeline-logger

A NodeJs timeline logger tool for generating timeline json files for viewing in the chrome browser

Timeline Logger

This logger helps generates a timeline JSON file that's compatible with the Chrome Dev Tools timeline viewer

npm install timeline-logger
var timeline = require('timeline-logger');
var builder = new timeline.TimelineBuilder();

// create a Program record
programEvent = builder.createEvent("Program");

// create a TimeStamp record
builder.createEvent("TimeStamp", {message: "hi mum!"});

//  do some stuff
for(var index; index<100; index++)
    console.log("Some output");

// end the TimeStamp record
builder.end();

// end the Program record
builder.end();

var logger = new timeline.TimelineLogger();
logger.save "some-file-path", programEvent

######TimelineLogger

nametypeargsdescription
savemethodstring filepath, timelineRecordList[]saves an array of timeline records to a file specified by the filepath

######TimelineBuilder

nametypeargsdescription
startEventmethodstring type, [object data]starts a timeline event. Types are defined in TimelineRecordTypes
endEventmethodnoneends the currently started timeline event.
<--resetmethodnoneresets all events back to no events -->

######TimelineRecord

nametypeargsdescription
startmethodnonesets startTime to Date.now()
endmethodnonesets endTime to Date.now()
startTimenumber
endTimenumber
childrenTimelineRecord[]
dataobject
frameIdnumber
usedHeapSizenumber
usedHeapSizeDeltanumber
countersobject
stackTraceobject

You can discover the history inside the History.md file

You can discover the contributing instructions inside the Contributing.md file

Licensed under the incredibly permissive MIT License
Copyright © 2013+ Stringz Solutions Ltd
Copyright © 2013+ Peter Flannery