lib/eep.fn.stats.js
function SumFunction(win) {
  var self = this, s;
  self.name = "sum";
  self.type = "simple";
  self.init = function() { s = 0; };
  self.accumulate = function(v) { s += v; };
  self.compensate = function(v) { s -= v; };
  self.emit = function()  { return s; };
  self.make = function(win) { return new SumFunction(win); };
}
function SumFunction(win) {
  var self = this, s;
  self.name = "sum";
  self.type = "simple";
  self.init = function() { s = 0; };
  self.accumulate = function(v) { s += v; };
  self.compensate = function(v) { s -= v; };
  self.emit = function()  { return s; };
  self.make = function(win) { return new SumFunction(win); };
}
function SumFunction ( win ) { var self = this , s ; self . name = "sum" ; self . type = "simple" ; self . init = function ( ) { s = 0 ; } ; self . accumulate = function ( v ) { s += v ; } ; self . compensate = function ( v ) { s -= v ; } ; self . emit = function ( ) { return s ; } ; self . make = function ( win ) { return new SumFunction ( win ) ; } ; }
Sum all the things
Sum all the things