Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Simplify threshold calculation #177

Merged
merged 1 commit into from

2 participants

@draco2003

This is in reference to pull 63
Has been updated to the new code in that section.
Change is also being committed to my branch that moves calculations back out of the backend.

@mrtazz
Owner

I'm confused about this. Is this also in pull request 167 or not? And if it is why did you resubmit it here?

@draco2003

Sorry for the confusion. This is an updated patch for the pull request #63.
Figured this was a simple patch that could be applied while waiting for pull request 167 was pending review.

I was looking through the pull requests to see if any were related to the graphite.js metric calculation code in case i needed to apply them to the processed_metrics.js file.

I've added this patch to that pull request as well so its not lost in the transition:
draco2003@ecdc1cd

@mrtazz
Owner

Thanks!

@mrtazz mrtazz merged commit 3edcf08 into etsy:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 19, 2012
  1. @draco2003
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −2  backends/graphite.js
View
3  backends/graphite.js
@@ -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];
Something went wrong with that request. Please try again.