coffee-redis-tracker
Time and count function invoque tracker using redis
Last updated 4 years ago by charlyraffellini .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install coffee-redis-tracker 
SYNC missed versions from official npm registry.

Coffeescript Redis Tracker

var Klass, Promise, Tracker, tracker;
Promise = require("bluebird");
tracker = require('coffee-redis-tracker');

function getRandomInt(min, max) {
  return Math.floor(Math.random() * (max - min)) + min;
}

Klass = (function() {
  function Klass() {}
  Klass.prototype.message = function() {
    return Promise.delay(getRandomInt(50, 500));
  };
  Klass.prototype.withCb = function(arg, second, cb) {
    return setTimeout((function(_this) {
      return function() {
        return cb(_this.state);
      };
    })(this), getRandomInt(50, 500));
  };
  return Klass;
})();

tracker.wrapCounterAndTimerOverMethod(Klass, "message", "testing");
tracker.wrapCounterAndTimerOverCallback(Klass, "withCb", "testing");

function Go(){
  new Klass().message();
  new Klass().withCb(1, 2, (function(err) { return true; }));
}

setInterval(Go, 100);

Current Tags

  • 0.0.2                                ...           latest (4 years ago)

3 Versions

  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |