Informer, you know say daddy snow... ahem A status middleware for your express server


Informant is a lightweight way to monitor server resources in real-time. It can be used as an Express.JS middleware or standalone. When running as middleware each request is logged to the provided store.

Navigate to

http://<server where you are running informant>:2222/
npm install informant

First, require informant:

var informant = require('informant');

If you are using it as middleware with Express:

var express = require('express');
var app = express.createServer();

If you are using it as a standalone app:

cd <node_modules where informant installed>
 node run

Setting these three environment variables effects the operation of informant:

INFORMANT_PORT         = 2222 # Port the server interface response (default is 2222)
INFORMANT_INTERVAL     = 5000 # Sample rate in milliseconds for data (default is 5000)
INFORMANT_MEM_STORAGE  = 2000 # Number of items the Memory Store will retain is 2000

The Store API is a simple API designed to persist data. If no store is supplied then the in memory store will be used.

Stores conform to this interface:

    cb = function(err,records) {}
    var store = {
        insertfunction(record) {}
        findfunction(query,cb) {}
        add_machinefunction(record) {}
        get_machinesfunction(cb) {}

The supplied stores are:

var informant = require('informant');
var mem_store = new informant.MemStore();
var mongo_store = new informant.MongoStore();

To use a store, pass it into the init method:


MemoryStore example:

var MemStore = function() {
   var env_var_mem = parseInt(process.env.INFORMANT_MEM_STORAGE); 
   var mem_storage = env_var_mem || 2000; 
   this.machines = [];
   console.log('Using MemStore for Storage with a history of '+mem_storage+' items.');
   this.mem = [];
   this.insert = function(rec) {
      if(this.mem.length>=mem_storage) {
   this.find = function(query,cb) {
   this.add_machine = function(rec) {
   this.get_machines = function(cb) {