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 Feb 17, 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.
@arteam arteam force-pushed the support_for_overriding_decimal_format branch from 42f49b8 to 0f03ac4 Feb 17, 2017
@arteam arteam removed the unable to merge label Feb 17, 2017
@ryantenney
Copy link
Member

@ryantenney 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
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.