Permalink
Browse files

Merge pull request #177 from draco2003/simplify-thresholds

Simplify threshold calculation
  • Loading branch information...
mrtazz committed Oct 27, 2012
2 parents c14e21b + 922e9e5 commit 3edcf083e84c0fdb45a190594ec2b3796a032953
Showing with 1 addition and 2 deletions.
  1. +1 −2 backends/graphite.js
View
@@ -95,8 +95,7 @@ var flush_stats = function graphite_flush(ts, metrics) {
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 3edcf08

Please sign in to comment.