Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses the 'tdigest' library to calculate percentiles. #41

Closed
wants to merge 1 commit into from

Conversation

Tyler-Murphy
Copy link

More information about the library here: https://github.com/welch/tdigest.

This will mean that percentile estimates are more accurate when there aren't very many samples used in the percentile calculation, but it also means that percentiles are estimates of what percentiles would be, given more points, rather than actual percentiles, which may not be what you're going for.

This sounds like it could close #19, since it's set up to compress the distribution after every 1000 points are added.

@@ -188,12 +188,12 @@ describe('Histogram', function() {
f = h.flush();

f.should.have.deep.property('[5].metric', 'hist.75percentile');
f.should.have.deep.property('[5].points[0][1]', 75);
f.should.have.deep.property('[5].points[0][1]', 75.5);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are because of the different algorithm tdigest uses.

@Tyler-Murphy
Copy link
Author

@dbader, what do you think of this change?

@dbader
Copy link
Owner

dbader commented Jul 8, 2018

Hey @Tyler-Murphy, thanks for the PR. Not a huge fan to be honest due to the extra dependency & questionable value add (for my personal use cases).

@Tyler-Murphy
Copy link
Author

Okay. What would you think of allowing a percentile calculator to be injected, kind of like how a custom HTTP agent can be provided?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cap the number of samples in node-datadog-metrics
2 participants