'use strict';

var Page = require('bigpipe').Page
  , Dynamis = require('dynamis')
  , Collector = require('npm-probe')
  , contour = require('../contour')
  , nodejitsu = require('nodejitsu-app');

//
// Initialize our data collection instance and the CouchDB cache layer.
//
var couchdb = nodejitsu.config.get('couchdb')
  , cradle = new (require('cradle')).Connection(couchdb)
  , collector = new Collector({
      cache: new Dynamis('cradle', cradle, couchdb),
      probes: [
        Collector.probes.ping
      ]
    });

//
// Extend the default page.
//
Page.extend({
  path: '/',
  view: '../views/index.ejs',

  pagelets: {
    navigation: contour.navigation.extend({
      data: {
        base: '',
        login: false,
        signup: false,
        navigation: [
          { name: 'Recent', href: '/recent/' },
          { name: 'Packages', href: '/packages/' },
          { name: 'Authors', href: '/authors/' },
          { name: 'Help', href: '/help/' },
        ]
      }
    }),

    status: require('registry-status-pagelet').extend({
      collector: collector
    })

    //footer: contour.footer
  }
}).on(module);
@@ -507,22 +507,100 @@
 ping
-%0A      %5D%0A    %7D
+,%0A        Collector.probes.delta%0A      %5D%0A    %7D);%0A%0Acollector.on('probe::error', console.error
 );%0A%0A

add delta probe for testing purposes