Permalink
Browse files

Simplify threshold calculation

  • Loading branch information...
draco2003 committed Oct 19, 2012
1 parent dd21c20 commit 922e9e58c57ae4e61268cbd6925c112f0e4e468c
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 922e9e5

Please sign in to comment.