memshaw
Hapijs plugin to monitor your application's memory
Last updated 2 years ago by global_1981 .
ISC · Repository · Bugs · Original npm · Tarball
$ cnpm install memshaw 
SYNC missed versions from official npm registry.

Memshaw

Monitor your hapi application's memory footprint.

Screenshot

Inspired by PubNub-Rickshaw-Memory, this plugin displays a realtime graph of your NodeJS memory profile over time. It uses socket.io for pushing data to the browser and Shutterstock's Rickshaw library for graphing.

usage

  1. Add the memshaw plugin to your hapi installation, here I am using a manifest file with the glue plugin:
{
  ...
  registrations: [
    { plugin: { register: 'memshaw' } },
    ...
  ]
}
  1. Visit your application in the browser using the /memshaw path i.e. localhost:3000/memshaw

  2. Get your app to chew on some memory! For example you could have a terrible route that you curl http://localhost:3000/stress like this:

server.route({
  method: 'GET',
  path: '/stress',
  handler: (request, reply) => {
    const stupidBigArray = [];
    fs.createReadStream('/path/to/big/file', 'utf8')
      .on('data', (chunk) => {
        console.log('got %d bytes of data', chunk.length);
        stupidBigArray.push(chunk);
      });
    reply('Why are you pushing all these chunks to an array?');
  },
});

resources

Rickshaw example

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |