0.0.1 • Published 12 years ago

hud v0.0.1

Weekly downloads
1
License
-
Repository
github
Last release
12 years ago

HUD - Head Up Display

pre-configured graphing for monitoring node stuff in real-time.

var hud = require('hud')()
var from = require('from') 
var os   = require('os')

//take something you want to monitor.
//oh yeah, make it a stream.
//from == a simple way to make a readable stream.
var osStream = 
  from(function (i, next) {
    this.emit('data', {
      memory: 1 - (os.freemem() / os.totalmem()),
      //make sure you add a time property.
      //else, monitor will use the time it receives the data
      //which may not be accurate.
      time: Date.now()
    })
    setTimeout(next, 1e3)
  })

osStream.pipe(hud.createStream('memory'))

//start a server on local host...
hud.listen(6464)

now, open http://localhost:6464 in your browser!

//hud can even monitor it self!
//using probe-stream
hud.probe.pipe(hud.createStream('monitor'))

Of course, you can monitor anything! I recommend using probe-stream

How

hud uses smoothie-stream it will graph the properties that are numbers.

License

MIT