aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2014-06-12 22:16:54 -0300
committerDiego <diegolparra@gmail.com>2014-06-12 22:16:54 -0300
commite3d16846beb4ce0a629a79430d8742f369a73a32 (patch)
tree52d1c827bbe84d5d0051029c7d200b637ab1813e
parent103b6c225f8841268f881f279d37940a31c93b1e (diff)
downloadKamon-e3d16846beb4ce0a629a79430d8742f369a73a32.tar.gz
Kamon-e3d16846beb4ce0a629a79430d8742f369a73a32.tar.bz2
Kamon-e3d16846beb4ce0a629a79430d8742f369a73a32.zip
= datadog: force the decimal format to use dot (.) as decimal point
-rw-r--r--kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala b/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala
index 5b7ca471..0d33ba1d 100644
--- a/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala
+++ b/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala
@@ -23,16 +23,21 @@ 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 kamon.metrics.{ MetricIdentity, MetricGroupIdentity }
+import java.util.Locale
class DatadogMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long) extends Actor with UdpExtensionProvider {
import context.system
val appName = context.system.settings.config.getString("kamon.datadog.application-name")
- 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
@@ -49,7 +54,7 @@ class DatadogMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long
val dataBuilder = new MetricDataPacketBuilder(maxPacketSizeInBytes, udpSender, remote)
for {
- (groupIdentity, groupSnapshot) ← tick.metrics;
+ (groupIdentity, groupSnapshot) ← tick.metrics
(metricIdentity, metricSnapshot) ← groupSnapshot.metrics
} {