From 6778724e1f0d12e7921dbde42233f49212550579 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Mon, 9 Jun 2014 16:03:16 -0300 Subject: = statsd: force the decimal format to use dot (.) as decimal point separator --- .../src/main/scala/kamon/statsd/StatsDMetricsSender.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'kamon-statsd/src/main/scala/kamon/statsd') 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 -- cgit v1.2.3