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

Add support for overriding format of floating numbers in Graphite #1073

Merged
merged 1 commit into from Feb 17, 2017

Conversation

arteam
Copy link
Member

@arteam arteam commented Feb 15, 2017

Currently, we trim all decimal values to 2 digits after the point. Despite that's a good default, some applications require reporting floating numbers with better precision.

For those users we provide the ability to override the format(double v) method of GraphiteReporter. User can provide a custom format (or just use a plain double-to-string conversion). We also need to make the constructor of GraphiteReporter protected, because users can't override a class with a private constructor.

@jplock jplock added this to the 3.2.0 milestone Feb 15, 2017
@arteam arteam force-pushed the support_for_overriding_decimal_format branch 2 times, most recently from 96d328f to 42f49b8 Compare February 17, 2017 15:54
Currently, we trim all decimal values to 2 digits after the point. Despite
that's a good default, some applications require reporting floating numbers
with better precision.

For those users we provide the ability to override the `format(double v)`
method of `GraphiteReporter`. User can provide a custom format (or just use
a plain double-to-string conversion). We also need to make the constructor
of `GraphiteReporter` protected, because users can't override a class with
a private constructor.
@ryantenney
Copy link
Member

I like this approach! Makes it possible for the few people that want this feature without adding any cruft.

@arteam arteam merged commit ad94296 into 3.2-development Feb 17, 2017
@arteam arteam deleted the support_for_overriding_decimal_format branch February 17, 2017 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants