diff --git a/lib/stats.js b/lib/stats.js index ab1d032..f2a9dbf 100644 --- a/lib/stats.js +++ b/lib/stats.js @@ -235,7 +235,7 @@ Uniques.prototype = { }, clear: function() { this.items = {}; - this.unqiues = 0; + this.uniques = 0; this.length = 0; }, summary: function() { diff --git a/nodeload.js b/nodeload.js index 7712c72..7c0f1d4 100755 --- a/nodeload.js +++ b/nodeload.js @@ -22,7 +22,7 @@ this.length++;},get:function(item){if(item.length>0){var total=0;for(var i in it return total;}else{return this.items[item];}},clear:function(){this.start=new Date();this.items={};this.length=0;},summary:function(){var items={};for(var i in this.items){items[i]=this.items[i];} items.total=this.length;items.rps=Number((this.length/((new Date()-this.start)/1000)).toFixed(1));return items;},merge:function(other){for(var i in other.items){if(this.items[i]!==undefined){this.items[i]+=other.items[i];}else{this.items[i]=other.items[i];}} this.length+=other.length;}};var Uniques=stats.Uniques=function Uniques(){this.type='Uniques';this.start=new Date();this.items={};this.uniques=0;this.length=0;};Uniques.prototype={put:function(item){if(this.items[item]!==undefined){this.items[item]++;}else{this.items[item]=1;this.uniques++;} -this.length++;},get:function(){return this.uniques;},clear:function(){this.items={};this.unqiues=0;this.length=0;},summary:function(){return{total:this.length,uniqs:this.uniques};},merge:function(other){for(var i in other.items){if(this.items[i]!==undefined){this.items[i]+=other.items[i];}else{this.items[i]=other.items[i];this.uniques++;}} +this.length++;},get:function(){return this.uniques;},clear:function(){this.items={};this.uniques=0;this.length=0;},summary:function(){return{total:this.length,uniqs:this.uniques};},merge:function(other){for(var i in other.items){if(this.items[i]!==undefined){this.items[i]+=other.items[i];}else{this.items[i]=other.items[i];this.uniques++;}} this.length+=other.length;}};var Peak=stats.Peak=function Peak(){this.type='Peak';this.peak=0;this.length=0;};Peak.prototype={put:function(item){if(this.peak