0.0.2 • Published 10 years ago

hapi-elapsed v0.0.2

Weekly downloads
1
License
-
Repository
-
Last release
10 years ago

hapi-elapsed: Hapi plugin which logs elapsed time

Build Status

Installation

Requires node.js >= 0.12

npm install ## install dependent node modules

Usage

// listen for our new elapsed log event
server.pack.events.on('log', function (event, tags) {
  if (tags.elapsed) {
    // do something with the elapsed event
    console.log('elapsed', event);
  }
});

var plugins = {
  'hapi-elapsed': {}
};
server.pack.require(plugins, function (err) {
  if (err) { throw err; }
  // plugin required, start server
});

Goals

  • compute elapsed time from the beginning of request to the end of the response
  • emit log event with elapsed time

Why

A simple functional Hapi plugin which calculates and logs elapsed time

Get involved

If you have input or ideas or would like to get involved, you may:

License

0.0.2

10 years ago

0.0.1

11 years ago