diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-06-09 16:03:16 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-06-09 16:07:35 -0300 |
commit | 6778724e1f0d12e7921dbde42233f49212550579 (patch) | |
tree | 71e8aba905405b0c33227fbf4047966c3156348c /kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala | |
parent | 55f00dc550176fb21df0dc7d080711647d36c839 (diff) | |
download | Kamon-6778724e1f0d12e7921dbde42233f49212550579.tar.gz Kamon-6778724e1f0d12e7921dbde42233f49212550579.tar.bz2 Kamon-6778724e1f0d12e7921dbde42233f49212550579.zip |
= statsd: force the decimal format to use dot (.) as decimal point separator
Diffstat (limited to 'kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala')
-rw-r--r-- | kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala b/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala index 470d6c23..adda18cc 100644 --- a/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala +++ b/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala @@ -23,14 +23,18 @@ import akka.util.ByteString import kamon.metrics.Subscriptions.TickMetricSnapshot import kamon.metrics.MetricSnapshot.Measurement import kamon.metrics.InstrumentTypes.{ Counter, Gauge, Histogram, InstrumentType } -import java.text.DecimalFormat +import java.text.{ DecimalFormatSymbols, DecimalFormat } +import java.util.Locale class StatsDMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long) extends Actor with UdpExtensionProvider { import context.system val metricKeyGenerator = new SimpleMetricKeyGenerator(context.system.settings.config) - val samplingRateFormat = new DecimalFormat() - samplingRateFormat.setMaximumFractionDigits(128) // Absurdly high, let the other end loss precision if it needs to. + val symbols = DecimalFormatSymbols.getInstance(Locale.US) + symbols.setDecimalSeparator('.') // Just in case there is some weird locale config we are not aware of. + + // Absurdly high number of decimal digits, let the other end lose precision if it needs to. + val samplingRateFormat = new DecimalFormat("#.################################################################", symbols) udpExtension ! Udp.SimpleSender |