Skip to content
Browse files

Fixed clear() method.

clear() method now sets component values as though the object were
newly created; it is now consistent with new().
  • Loading branch information...
1 parent bbe9313 commit 136e8cc7e6351c57f19d6599a1ae0236d8a4ff63 Michael S. Fischer committed Jun 27, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 metrics/histogram.js
View
7 metrics/histogram.js
@@ -23,9 +23,10 @@ Histogram.prototype.clear = function() {
this.sample.clear();
this.min = null;
this.max = null;
- this.sum = 0;
- this.varianceM = -1;
- this.varianceS = 0;
+ this.sum = null;
+ this.varianceM = null;
+ this.varianceS = null;
+ this.count = 0;
}
// timestamp param primarily used for testing

0 comments on commit 136e8cc

Please sign in to comment.
Something went wrong with that request. Please try again.