{"_id":"tempo","_rev":"65-0bce5592b7741a465cb0f51120267d53","name":"tempo","description":"Rotating Counters for Nodejs","dist-tags":{"latest":"0.2.7"},"versions":{"0.0.1-pre1":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.1-pre1","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.1-pre1","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"680b346358dcbb7311135736ca669fca4f596670","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.1-pre1.tgz","integrity":"sha512-dQHEcz0VaK7nxufHSTPLoEWwQ9ewv/hN2EOshK/xRJWidKudN0LAsFO40mMRbIqs6kT3LuNx9qT4IO5R/zL0SQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFfUei71qbcuSM7uB8iYz3T5IsQ9+vGea+RE2rLv3YvuAiAu+LLVZhBk8CxOT1oO1ifoETGeYKXeZBX3BAPKvjY8mQ=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.1":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.1","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.1","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"65110edc92da4fc70affe5afb3a8bc58e54ed778","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.1.tgz","integrity":"sha512-uezeRNFeXj7FitC/pXxPKloaBfdfstW9RRcxcdYPPN2MUPEbgdAlLX5ADLH/rolV2hCSawssC7g07uLqAwSygw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKaqEk/Vvksjya4jxv1URdjgVnkOkESHMXGFstqa08XAIhALofVTK/XtNhG6SzA+JxILFMb28Vmw8/rbKbRe2dngbU"}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.2":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.2","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.2","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"113e0e77cd572a433de89509192abb519ca5e919","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.2.tgz","integrity":"sha512-6BxFo9O1DjvY1Cv0dZeLmFK8l5xYhmjrSgL+BmA9ivyViBrp9Es8smeKxHVh3bWsPHXBuMIaAEjRNs5VkyBx4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEGWrqRjxql7hOsLEnN9h7wl7oVvQjHRuj96OqS8IcROAiBnOi6yPrSuBt3th7Yy7ZvurIc70MEhYjLy/2NWMXEheA=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.3":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.3","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.3","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"637bd87b96a8caa9e59cf8a95d9b5fd2fdc6ac93","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.3.tgz","integrity":"sha512-0tmZPd8NmplDg+U8gu1iAfheVfwSG8hvByWLv1JAh8Z1uuIyO8Yqqw0ZQPhGtpNHcb6mGy4NcdxPZlQXH2zDYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFddGdYk8AjOANKq+gw4amgx1grzMIN1TpfMAdP0SbjpAiEAzgMY0M7wYrX6PCx1V/bt5a2znGS4yRpzu2KaJZvNWpQ="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.5":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.5","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.5","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"b75c5a183447c0dc9870136bc7cd2826c7b6d4df","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.5.tgz","integrity":"sha512-7JIzp48bCtU7YlxqltmOPINBRbzm9cApElAv70btJmJ6QN9qsKnQJ99UQRs1dcCZtC3qVpQVHv9fxiFOQTW0JA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0O5BH/iU2kpivXix2fp8n/mLmtwdFhf+FOntJKV43YwIhAL17VNbixg2MdxsOX3OHbDS6DK5pS8B7JakR7X0/5eNY"}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.6":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.6","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.6","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"a2407b19adb344ca4fcc7b1b654b01cac2610e5f","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.6.tgz","integrity":"sha512-h9E9y6PlfoCi2/Z387bm8Bz5q98z0lu651KO9RISZlno18wmFuUYw1ynm2O7REwgaQeoDkAHLQHIY9OZCPj5Pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ4S+iphIpWYKuVrCBdVU8D+2k1qZuq01/C1n30LCDpwIgZM5NYcbyEyhIfvCSqrkYVpIRLXkFw0W3nwl94BiAeWw="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.7":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.7","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.5.1","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.7","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"de2efe060f68bd90f0425f3b159ae1bb260e416e","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.7.tgz","integrity":"sha512-b+nD+vLO4Mc9bOKYr8woPyTF+yrhKoNegKoft2SlDgdgZWmdsml/aTcOC6Z4+6jGQQkVTbc2XUZz1KuBW90qPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICquUA5+JiqMvUamYmlKmjZo4uqvk99sUQRbGPD52fCNAiAlndbtayUUcXhQXYiDrSGMjhKzotRrkdGMkFi6wJWQgw=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.0.8":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.0.8","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3","nested":"0.0.1-pre2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"_id":"tempo@0.0.8","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"18e2ec212cc3db2d4d71579956d98535b6a13269","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.0.8.tgz","integrity":"sha512-qbDf/ofpiOsdIVk8OtrytGG3d0mad+LRZJIGX66ObwecDnWrwBkZrVDV1BDxs10ZCPd1X5tW+hBTDWJXnC0KKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE7VedPkKb6s2jLTeMdA4OF8H7CpfRuGEe6KTgns9Z41AiB9SQ+xIZprkVQ0wPAdmzAncXrsPw3mofIAdJbwWAqwmg=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre1":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre1","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. preset counters for: min, hour, day, week\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var tempo = require('tempo').min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    tempo.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n```\n\n# DataStore\n\nThe tempo DataStore class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var datastore = new tempo.DataStore(options)\n\n  1. options:\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.DataStore({ per: 60000, buckets: 60 });\n```\n\n### datastore.increment(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### datastore.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### datastore.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  datastore.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre1","dist":{"shasum":"942aea6f4704aca22dbb3903f5874ce831403132","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre1.tgz","integrity":"sha512-EroLfLrXNcX3vGAamxB7DQukYJ6N2nct7hso8DCqhePyLqduIGD5KXQeU3my2k/8E58oH8MA1VA1iYdZsZrsZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdAjbcLt0I6PZ+AHcRvg6wiwtE52d6mbl7IljxgZ2GuAiB6wbUFIowYeywqHdkF9Pfy1CAWntfWmHTwoR/LX/W9qg=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre2":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre2","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. preset counters for: min, hour, day, week\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var tempo = require('tempo').min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    tempo.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n```\n\n# DataStore\n\nThe tempo DataStore class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var datastore = new tempo.DataStore(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.DataStore({ per: 60000, buckets: 60 });\n```\n\n### datastore.increment(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### datastore.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### datastore.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  datastore.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre2","dist":{"shasum":"09596b9b5c9630752d9eed88947314d14ad1b5c1","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre2.tgz","integrity":"sha512-oLCpmSGakvl/KhFxejClaVUYbrcLWrTuGxSpUTYxtg14ZW/Qd3iFG2khLJbsVlvrfm2EbPt4IGZom0dOtZ52ow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChFzWdlTJmf3TB7cNFK7A78C2BaH26NmI0rEH5KmhwGAIgF99NnHUOBpU293gNdS87HqIDZ5OeqxcFb14dE2gJw3E="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre3":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre3","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. preset counters for: min, hour, day, week\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var tempo = require('tempo').min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    tempo.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n```\n\n# DataStore\n\nThe tempo DataStore class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var datastore = new tempo.DataStore(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.DataStore({ per: 60000, buckets: 60 });\n```\n\n### datastore.increment(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### datastore.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### datastore.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  datastore.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre3","dist":{"shasum":"5f48353917e7bd94e61be44bec684507292d0c5a","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre3.tgz","integrity":"sha512-JU9jXOg0M5qK3ZP8m6q9RaL7aTpRg+ddDttBRvzNHePHptLbi8cmO52GgqAyOehO6p7b1SPm3ywYzW1GwTHwpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQllHdE396UEfWwNyyaWYA+Mm+3AqqYk/yfGVkM6rPcAiEA6UHWWkISQ7T7iK8rOCG11F3FqcskaJhSqUWEbtLOKuE="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre4":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre4","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create counter, increment and sync\n  var counter = new tempo.Counter();\n  counter.inc('hello');\n  counter.inc('hello', 5);\n  counter.sync(redis, 'my-counter', function (err) { if (!err) console.log('synced') });\n\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre4","dist":{"shasum":"1cd3c6dedd62aa7e3271353e2fb9f58b23a01f90","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre4.tgz","integrity":"sha512-lUzH2QnvB+7hyzX/s4Ped6lV5KaxfYsX0gAafwBnDMoQOgd+9vJOyGsVAtAUDv3OyS17Aeqs4S4mADwFHAVsrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtTZTkMkOIHBgkt/SMqoJbv9waRyqMzWyr9F4YjBR6GQIhANHDOWBmhkpYkgiZ2o3sErrGs2CQU1/zpf7/CV+uBimg"}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre5":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre5","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create counter, increment and sync\n  var counter = new tempo.Counter();\n  counter.inc('hello');\n  counter.inc('hello', 5);\n  counter.sync(redis, 'my-counter', function (err) { if (!err) console.log('synced') });\n\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre5","dist":{"shasum":"7936ab6b72d90718f2b892f0ef7e3d010f4722fa","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre5.tgz","integrity":"sha512-FCJjaOraaVmdOPAwGgRerL5SmYOXe14mZ3RmmxIeIlxm1R7nK6JkUKas8LepEB5Ocpi4DZgYCZ/Ps3ED8rHbxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEMF22WshoDEzaHSeKK520azVNYocf7eVHkt84doWkGAAiEAvqDlWSPSNZUcKLUrs3ab03MdlBBabMMrfr8R3ZlrXeU="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre6":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre6","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create counter, increment and sync\n  var counter = new tempo.Counter();\n  counter.inc('hello');\n  counter.inc('hello', 5);\n  counter.sync(redis, 'my-counter', function (err) { if (!err) console.log('synced') });\n\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre6","dist":{"shasum":"c95d207f6f603832d5e861d8ee3610b4e0bb062c","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre6.tgz","integrity":"sha512-EbRcHTf/oxKbye7J5xI5ZNdZgCEyBKI/zUKv/6/ckDREcgPtUaFkPFW8edqLqW5RfY3LZhP29au32tKGMgjNHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDiiVJRbDtRGevf/3ZEI1XP8122UBUvelp1M8Wwjv+1gAiEAzIydGz2EoW+Kil6JxzkSeBiYSdlZp/5br+mLdYq5YEA="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre7":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre7","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create counter, increment and sync\n  var counter = new tempo.Counter();\n  counter.inc('hello');\n  counter.inc('hello', 5);\n  counter.sync(redis, 'my-counter', function (err) { if (!err) console.log('synced') });\n\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre7","dist":{"shasum":"c6da9b3addd697b6b13aae696aedbb82703a9e5a","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre7.tgz","integrity":"sha512-uLqET2zqNNW4JwO9Hg7rL6ceV7knJemeRHZUdnFy8dGg4gK+E5Gh7iyIGKKfW1Jkw/uQXs/j0Ej0EKRDVgNxTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkL+ipOpxcf97sJOPUDFEtoLYPihqKviAlAjwalvWqtQIhALIZ6kY9xo1in+mSgPhTpVmX1KvNzvYqKS6TpEcG2DLw"}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre8":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre8","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.3"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create counter, increment and sync\n  var counter = new tempo.Counter();\n  counter.inc('hello');\n  counter.inc('hello', 5);\n  counter.sync(redis, 'my-counter', function (err) { if (!err) console.log('synced') });\n\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats');\n```\n","_id":"tempo@0.1.0-pre8","dist":{"shasum":"f78f2abb5aa239d895babe628e61eb7d032a764e","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre8.tgz","integrity":"sha512-kUBc71/IC3JYQt1gnA2BFUNs29+h10yhT5zj8ntjIgNMxZhd50CVwF6H9QreBKdj/iU/xn4Fj8f9PhZEWpqgDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhsbkFok/3gLBJLb6QXQI5Weg+cmPihKMjJpsVAQdyegIgbfHUwDfMnkGnHtvi90SWRzrSorPRZSGLYG/bBioR7Fc="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre9":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre9","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.11"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats', callback);\n```\n","_id":"tempo@0.1.0-pre9","dist":{"shasum":"df6ee972715cba650701b7bea558c0c56e7a0658","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre9.tgz","integrity":"sha512-NDotQyNqNBwU3ZNKM7FRLyeXu4MljT2ECcf5Lw25ipXUgmz8hZ/Q/fXd33ZCqdLk5xy02iPzDN1c43v7HdeQUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD67uYCJKgDHSVeUzm1JvLKNPaLJGLAzWwEtLd+xm08EQIhAIM2XgoXN2xLUmjugolYrUczezsfMbvaT6UAmGZOF3+K"}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre10":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre10","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.13"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.incr(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats', callback);\n```\n","_id":"tempo@0.1.0-pre10","dist":{"shasum":"79e46275c0455c061910295971a5ec528dae476f","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre10.tgz","integrity":"sha512-TlDZKiFLX5r3+tCfFHVPUaRMpjSG3Eg5ZYPHdAWj+8fXibUuwvc1D7KGRxCRIEENxypRVsUKYgAh+qRgl2YeBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD43L4WvhaRu7Qr9dE6dfWDSju5SReTXTA7OJfVlyuyPAIgbCLe8lC0prGJq2DJ6cSKyvjP67ZWKut6+hralEyOkfw="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0-pre11":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0-pre11","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.13"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. sparse logging: keep a defined number of random entries in a log\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    next();\n  })\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): ttl pass expiration time\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.inc(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key, attr1, attr2, ...)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats', callback);\n```\n","_id":"tempo@0.1.0-pre11","dist":{"shasum":"39e98ad611f4ea3735aaa32f6074eac148666bc2","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0-pre11.tgz","integrity":"sha512-yKLNMDen9Sk+08fsbjS6jn4guK6ltsGY6wuR5pNEGy/3RznljUGIIIn6MY7yzD2U8nDofEUTouDvlFs43ImYUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICBFjeiLk7F8MM0DSBX9z0PN/cHpbyGg1cgSUd0vm8P3AiBEvG2EMcoo6IBP+y87CvUwI6nrIafQpJl4MgFBrjDwug=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.1.0":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.1.0","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"dependencies":{"mochiscript":">=0.6.14"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPassMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# TimedCounter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var timedCounter = new tempo.TimedCounter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### timedCounter.inc(key, n);\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```\n  var ds = require('tempo').hour();\n  ds.increment(userId);\n```\n\n### timedCounter.getHistory(key)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### timedCounter.sync(redis, namespace)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n\n```\n  timedCounter.sync(redis, 'web-stats', callback);\n```\n","_id":"tempo@0.1.0","dist":{"shasum":"f7e50764466004ff1c254f2cdd8acca281f12a43","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.1.0.tgz","integrity":"sha512-/CXgo5pUN3fqs4KMXlciTDCx7XftFo9KD+0GCJ+wH2vYG+lwzHlcJCYyr3qNeujmj8XfhgYMCHNUfqTXGdhmig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDKAh8LfhlDV4WJwul4u9wSWoA2rpEn7gldTk0QMxxB+AiBE59KO3eCWd19kT8TTcdIV7hKpM0I85jGodUfbhwn3xg=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.0-pre1":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.0-pre1","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"scripts":{"test":"whiskey 'tests/increment.js tests/syncer.js tests/functional.js'"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPassMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    var history = tempo.getHistory('requests');\n    var times   = tempo.getTimes();\n\n    for (var i=0; i<history.length; i++) {\n      console.log(\"Requsts at \" + (new Date(times[i])).toString() + ': ' + history[i]); \n    }\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.0-pre1","dist":{"shasum":"baf0d96aeebd4c3a8191086bf05d2102333e67ac","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.0-pre1.tgz","integrity":"sha512-gVxaS5CpwIBPMusvvm2dAhpBwfNdngFfLiunsoOA6Yzg98vHdxe1mCRlPOEWwZoXyxe/BFjcsR0PaPNghgwYsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpqE8jvUZHqFk7OB/nVNLemIAtAEtDABkx0cGWPv2eZwIhAPjAmD6VJcpx17zD55Em+8i1R+4Mr5t3v6XSuCl77Buq"}]},"_npmVersion":"1.1.63","_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.0-pre2":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.0-pre2","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"scripts":{"test":"whiskey 'tests/increment.js tests/syncer.js tests/functional.js tests/iterators.js'"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.0-pre2","dist":{"shasum":"f90f47570e49e5aa4b5ef1026b41d88162243096","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.0-pre2.tgz","integrity":"sha512-XEq6oiVAUFlvTipUjDpncbJH9J2tk/634OYoRfFLdyx3UCZTuCY0aGXQ1MxeoGqSyBAXnTdBLKuHxbojUxMOLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDi6yK4ra2aivg3UA5iB0UK5ETfx+Z4irC2L0NVRcyFJAIhANfCnbhx4v5OgUrxxqAwTijbe+rMYLYxBYqWinPhuag5"}]},"_npmVersion":"1.1.63","_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.0-pre3":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.0-pre3","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./lib/tempo/index","bin":{},"scripts":{"test":"whiskey 'tests/increment.js tests/syncer.js tests/functional.js tests/iterators.js'"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.0-pre3","dist":{"shasum":"570db1553ac478f0c5699f42a6d00da3432fb1df","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.0-pre3.tgz","integrity":"sha512-irVUJ9mVjC7M1GWOCJT++SYctIlOm/wFO5BjuPP3jJ0ycw5lpvxWPGI7k2TJZX26Rh7Oi1aecDwMrI56NDpE5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpAc0CXh8UOusxDWzsWccpoPTq4srGVSU+7UDmJSB3OgIgLj2jA1CChICIUYu5A9vACtmttq266OJr6G1mZ4YabO0="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.0":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.0","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"whiskey 'tests/increment.js tests/syncer.js tests/functional.js tests/iterators.js'"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.0","dist":{"shasum":"40d8fa95e7e8c743205188cf730c7ce70413363c","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.0.tgz","integrity":"sha512-/yefH9hauZfuZxnWTot7H5wkXicmFhZ5VknXp52INnxPiOftBLYInd7EwjphVYLyYYqkie8YpXd4iJlR2aF83w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDReZbog7S52adMTCbsQQBsmAy1Ynt26uVBZJuqtFIhCwIgLHJE/tgyu6QPanQ8yNrHFHSHWG4sUCOZbZuxVSnc/7A="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.2":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.2","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"node tests"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2","nodeunit":"~0.7.4","redis":"~0.8.1","async":"~0.1.22"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.2","dist":{"shasum":"24684636b18349daf051ec6d72b867625b363404","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.2.tgz","integrity":"sha512-OzMFfz+XgsFZfhWdLCUbJw+6TzrJ5a/k+fm6JXAcvfZszr9ne3kgXx8RQihB3nKgsj0XrOPVZ1cv/IxrPGA3dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGNfucgGG3LyUL0IviS5r2a29nFr2opUa+rRNZcV0iUUAiAaoKtKvFfcNVve7J/Lk37wIBPOKORscVWDc6SERglVNQ=="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.3":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.3","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"node tests"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2","nodeunit":"~0.7.4","redis":"~0.8.1","async":"~0.1.22"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.3","dist":{"shasum":"7667994c3731b0e2f02f0e464d2de4bfcfff095c","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.3.tgz","integrity":"sha512-zwbmxg5RgBWJXSo112izPBhDUeNoCq0sTgv3pnuP9Z/2R8YmXoPpbwD7PYpM5K7qnGVgV86ZgqlUK63WLOTPxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvlTu+5ftUgpxn2mrP/YNf3PPgfnvTqT4mrrfbPkwOggIgWb91FzwQ/xlHwiBro2P0BErdvz/+TDnOUegIVlSU0Mo="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.4":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.4","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"node tests"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2","nodeunit":"~0.7.4","redis":"~0.8.1","async":"~0.1.22"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.4","dist":{"shasum":"914dc52ce08a1669819a215c1e00bc9eb0a4b035","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.4.tgz","integrity":"sha512-1TgxKFEUBeFkFhDNpYsjtaKRRBCnE5oVEekb95wCuSU52U1xEwhWtbAMaqqdfG9Cb34Ws0VZIc9tEbU9gxlrgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBlCL58w3WS4o3cPXoH9yl5KsDlyjySdJfcsr0ZVxDR8AiEA0188KklL3GUVqx6PcQAo/d5Hz0FjO/HZcs6tlJBtNUI="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.5":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.5","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"node tests"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2","nodeunit":"~0.7.4","redis":"~0.8.1","async":"~0.1.22"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.5","dist":{"shasum":"82c2c3d2c00ab57d2b2f0662c396778f4d2d6ac4","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.5.tgz","integrity":"sha512-U5pB6sIqgmpXz+/19fIBzkVkXoHZodqNU0e5nnOBi9aYuW7WA/bedPuefRQAfEl0o1xDsAcAXLYOaIfB2d57Pg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjG4ARvEvBEpwpgvCF4ScW62+ZxE/wRVROR7s2wT1O+AiEA6qd/EjlUgHM1tWttDC/wwFnqIiIQ1JZtMNhvUO0VVFQ="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"jeffsu","email":"me@jeffsu.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.6":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.6","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"node tests"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2","nodeunit":"~0.7.4","redis":"~0.8.1","async":"~0.1.22"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","_id":"tempo@0.2.6","dist":{"shasum":"71d09aae3eb4b91148e6ced71eb3ac4c9531f22a","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.6.tgz","integrity":"sha512-ok4ebmcL2TNpSFklLdKGgg5Cehez6iPZAnJMpUvHGX/95Tht/yQJNLc/ljwGRX7dv09dRHlkxXfcrpNf8FSt9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCkHsSAJnTP1FP15hW/U9lZbX1mh5omnRruj/5MhPVJQIgRGcaTc6a1PBkRQMgWeuGNrSzNa294kBFkHUOTgQ/jN4="}]},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"}]},"0.2.7":{"name":"tempo","description":"Rotating Counters for Nodejs","keywords":["javascript","language","mochiscript","counter","stats"],"author":{"name":"Jeff Su"},"version":"0.2.7","licenses":[{"type":"MIT"}],"engines":{"node":">=0.4.0"},"directories":{"lib":"./lib/tempo"},"main":"./index.js","bin":{},"scripts":{"test":"node tests"},"dependencies":{"mochiscript":">=0.6.15"},"devDependencies":{"cli-table":">=0.0.2","nodeunit":"~0.7.4","redis":"~0.8.1","async":"~0.1.22"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"readme":"# Tempo\n\nScalable time-based counters that meant logging, graphing and providing a realtime statistics. All features in tempo are meant to have a constant size memory footprint defined by configuration.\n\nFor a quick example, please look at examples/simple-use-case.js\n\n# Features\n\n  1. simple counters that sync over redis using a hash structure\n  1. counters that keep track of historical data in buckets\n  1. syncing with redis for aggregation on multiple servers\n  1. throttling\n\n\n# Use Case\n\nLets say you are running a website and want to know in realtime where people are visiting.\n\n```javascript\n\n  var redis = require('redis').createClient();\n  var tempo = require('tempo');\n\n  // create middleware to track counts\n  // create time counter, increment and sync\n  var min = tempo.min();\n\n  app.use(function (req, res, next) {\n    // the '1' is unnecessary because increment defaults to '1'\n    min.inc('requests', 1); \n    if (min.getCount('requests') > 1000) return next('throttled');\n    next();\n  })\n\n  function showTotalRequestsInPastMin() {\n    min.getKeys().forEach(function (k) { console.log(k, min.getCount(k)) });\n  }\n\n  function showRequestsOverTime() {\n    min.eachCount('requests', function (count, time) {\n      console.log(\"Requsts at \" + (new Date(time)).toString() + ': ' + count); \n    });\n\n    console.log(tempo.getCount('requests') + ' request(s) made in the last minute'); \n  }\n\n```\n\n# Counter\n\nThe tempo TimedCounter class allows you to create a datastore object and keep\ndata in memory.\n\n## Instance methods\n\n### var counter = new tempo.Counter(options)\n\n  1. options hash\n    1. per: milliseconds per bucket\n    1. buckets: number of buckets\n    1. timeout (optional): Time to live. Mainly for redis syncing. Defaults to (per*bucket)+per*2\n\nExample for keeping data up to an hour of history:\n\n```javascript\nvar tempo = require('tempo');\nvar ds = new tempo.TimedCounter({ per: 60000, buckets: 60 });\n```\n\n### counter.inc(key, [n]); O(1)\n\n  1. key: entity name\n  1. n (optional, defaults to 1): a number to increment by.\n\nKeeping track of how many times a user has logged in in the past hour:\n```javascript\n  var ds = require('tempo').hour();\n  ds.inc(userId);\n```\n\n### counter.getHistory(key); O(n)\n\n   1. key: entity name\n\nGrabbing logged in counts:\n\n```javascript\n  var history = ds.getHistory(userId);\n```\n\nReturns an array of counts (per bucket)\n\n\n### counter.sync([callback]) O(nb)\n\n  1. redis client  \n  1. prefix/namespace for the key to store in redis\n    * tempo's keys will look something like \"<namespace>:<timestamp>\"\n  1. O(nt) where n is the number of keys and b is the number of buckets\n\n```javascript\n  counter.sync(redis, 'web-stats', callback);\n```\n\n### counter.getKeys(); O(nb)\n\nreturns and array of all the keys in the counter\nO(nt) where n is the number of keys and b is the number of buckets\n\n### counter.eachCount(key1, key2, ... [ callback ])\n\nRuns a callback against every bucket in the counter with arguments (see examples below):\n\n```\ncounter.eachCount('key1', 'key2', function (keyCount1, keyCount2, time) {\n  console.log('key1', keyCount1, ' at ' + (new Date(time)).toString());\n  console.log('key2', keyCount2, ' at ' + (new Date(time)).toString());\n});\n\n\n# Syncer\n\n```javascript\nvar tempo = require('tempo');\nvar syncer = new tempo.Syncer(redisClient);\n```\n\n## Instance methods\n\n### syncer.addCounter(counter);\n\nAdds a counter to the list of counters to sync at once\n\n### var counter = syncer.counter(options)\n\nShortcut to instantiate counter and add it\n\n### syncer.sync([ callback ])\n\nSyncs all counters to redis (push and pull)\n\n### syner.push([ callback ])\n\nPushes data  to redis\n\n### syncer.pull([ callback ])\n\nPulls data from redis\n\n### syncer.start(type, interval)\n\nStarts running a type of sync at given intervals between syncs\n\n```javascript\nsyncer.start('push', 3000) // push to redis every 3 seconds\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jeffsu/tempo/issues"},"_id":"tempo@0.2.7","dist":{"shasum":"7c81597238ea9856ac3277d69a8e02ebc3f88f44","tarball":"https://registry.npmjs.org/tempo/-/tempo-0.2.7.tgz","integrity":"sha512-eagH95ejs4CQPNFabvizj+qE5k4gwj5w+397plU5243RkPxy3jrQSIwR/my3kuIW7dUPah3xN2zeMrw9jI3XDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdZcTwtLkrCC7n/r14uAkgKll1QypbSiZZo/s/4WOQdwIgP6PDR1r3g+nsLkeHj2It+P8dPxpCmLrGsSKyvAPo7BM="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"agate","email":"agate.hao@gmail.com"},"maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"},{"name":"agate","email":"agate.hao@gmail.com"}]}},"readme":"# Tempo\n\nScalable time-based counters that are good logging, graphing and providing a window into \nservices.\n\n# API\n\n\n","maintainers":[{"name":"jeffsu","email":"me@jeffsu.com"},{"name":"agate","email":"agate.hao@gmail.com"}],"time":{"modified":"2022-06-27T04:43:18.533Z","created":"2012-03-27T17:55:58.649Z","0.0.1-pre1":"2012-03-27T17:55:59.939Z","0.0.1":"2012-04-11T13:06:47.530Z","0.0.2":"2012-04-13T16:13:41.821Z","0.0.3":"2012-04-18T14:58:14.479Z","0.0.5":"2012-06-01T16:34:18.275Z","0.0.6":"2012-06-06T02:18:25.013Z","0.0.7":"2012-06-15T16:46:53.991Z","0.0.8":"2012-07-13T22:23:24.918Z","0.1.0-pre1":"2012-07-31T22:28:10.359Z","0.1.0-pre2":"2012-07-31T22:50:21.781Z","0.1.0-pre3":"2012-08-01T23:16:06.713Z","0.1.0-pre4":"2012-08-06T22:38:47.426Z","0.1.0-pre5":"2012-08-16T15:41:29.785Z","0.1.0-pre6":"2012-08-24T22:24:20.188Z","0.1.0-pre7":"2012-08-25T04:52:29.932Z","0.1.0-pre8":"2012-08-31T19:52:54.220Z","0.1.0-pre9":"2012-09-06T18:46:36.477Z","0.1.0-pre10":"2012-09-10T01:58:12.790Z","0.1.0-pre11":"2012-09-12T00:46:35.421Z","0.1.0":"2012-09-13T11:43:26.576Z","0.2.0-pre1":"2012-10-22T21:54:51.711Z","0.2.0-pre2":"2012-10-23T21:50:21.960Z","0.2.0-pre3":"2012-10-24T21:05:00.916Z","0.2.0":"2012-10-26T07:12:57.724Z","0.2.2":"2012-11-01T04:23:00.252Z","0.2.3":"2012-11-01T17:50:10.561Z","0.2.4":"2012-11-01T21:16:13.479Z","0.2.5":"2012-11-27T16:46:37.975Z","0.2.6":"2012-12-05T07:02:07.363Z","0.2.7":"2013-07-16T01:54:40.894Z"},"author":{"name":"Jeff Su"},"repository":{"type":"git","url":"git://github.com/jeffsu/tempo.git"},"users":{"fgribreau":true}}