domain-trace-stream

Domain IO Tracing

npm install domain-trace-stream
4 downloads in the last week
16 downloads in the last month

domain-trace-stream Build Status

Provides an event stream with all the interesting IO events.

Install

$ npm install domain-trace-stream

Use

var DomainTraceStream = require('domain-trace-stream');

var stream = DomainTraceStream();

Or, with options:

var stream = DomainTraceStream({
  maxQueue: 1000 // default value
});

The stream emits objects like this:

{
  event: 'http-client-request-begin',
  trace_id: '1b506b1b-0dd9-4d18-957e-7e1c5e6bf0b3',
  time: 1363873938335518,
  timeDiff: 194623,
  method: 'GET',
  path: '/search.json',
  headers: {
    "host": "search.twitter.com",
    "content-type": "application/json"  
  },
  host: "search.twitter.com"
}

The emitted events are:

  • http-client-request-begin
  • http-client-request-end
  • http-client-response-begin
  • http-client-response-end
  • http-server-request-begin
  • http-server-request-end
  • http-server-response-end

License

MIT

npm loves you