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

Projects
None yet
3 participants
@arteam
Member

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

Add support for overriding format of floating numbers in Graphite
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

This comment has been minimized.

Show comment
Hide comment
@ryantenney

ryantenney Feb 17, 2017

Member

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

Member

ryantenney commented Feb 17, 2017

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@arteam arteam deleted the support_for_overriding_decimal_format branch Feb 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment