aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/performance/histogram.js
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-12-07 14:56:32 -0800
committerGravatar murgatroid99 <mlumish@google.com>2015-12-07 14:56:32 -0800
commit6acc5f757479d3603c01978d1a93de0d92b7a4eb (patch)
treedd5257ab25e87a68f522e3a1dbb0f51c33abe82f /src/node/performance/histogram.js
parent722f91038277520a6c564f4adb504552f7e2b328 (diff)
Fixed up the Node benchmark implementation
Diffstat (limited to 'src/node/performance/histogram.js')
-rw-r--r--src/node/performance/histogram.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node/performance/histogram.js b/src/node/performance/histogram.js
index 45e1c23a90..204d7d47da 100644
--- a/src/node/performance/histogram.js
+++ b/src/node/performance/histogram.js
@@ -87,6 +87,8 @@ Histogram.prototype.bucketStart = function(index) {
* @param {number} value The value to add
*/
Histogram.prototype.add = function(value) {
+ // Ensure value is a number
+ value = +value;
this.sum += value;
this.sum_of_squares += value * value;
this.count++;