Add support for overriding format of floating numbers in Graphite #1073
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
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 ofGraphiteReporter
. User can provide a custom format (or just use a plain double-to-string conversion). We also need to make the constructor ofGraphiteReporter
protected, because users can't override a class with a private constructor.