chrono_metrics

metrics abstract concept

npm install chrono_metrics
20 downloads in the last month

example

Chrono = require './chrono.coffee'
redis = require('redis').createClient 6379

map =
  bmp: ['ip','pub~ip']
  add: ['evt']
  top: ['geo','host~evt']

c = new Chrono redis, 'test_analytics', map

hit =
  ip: '76.189.188.142'
  evt: 'page_impression'
  pub: 'ntkzodcxmtlmzgji'
  geo: 'us'
  host: 'example.com'

i = 0; for x in [1..250]
  do ->

    nip = (Math.random().toString().substr(3,3) for [1..4])
    hit.ip = nip.join '.'

    c.record hit, ->
      ++ i; if i < 250 then return log "recorded ##{i} events"
      process.exit 1
npm loves you