Permalink
Browse files

Simplify calculation

  • Loading branch information...
1 parent 246fdae commit ecdc1cdb876deb7d1f4605ed9df42a8f85e2a4e2 @draco2003 committed Oct 19, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/process_metrics.js
@@ -41,8 +41,7 @@ var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
for (key2 in pctThreshold) {
var pct = pctThreshold[key2];
if (count > 1) {
- var thresholdIndex = Math.round(((100 - pct) / 100) * count);
- var numInThreshold = count - thresholdIndex;
+ var numInThreshold = Math.round(pct / 100 * count);
maxAtThreshold = values[numInThreshold - 1];
sum = cumulativeValues[numInThreshold - 1];

0 comments on commit ecdc1cd

Please sign in to comment.