diff options
author | Diego <diegolparra@gmail.com> | 2014-05-09 20:36:45 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-05-12 19:40:48 -0300 |
commit | 002ced85cf207b2aefbcbc496cc6787ef7b844cd (patch) | |
tree | d165edc0121d4c5be73f65e54808e92b15a38eb1 /kamon-datadog/src/main/scala/kamon/datadog | |
parent | 70ff2bb8d9c3c929e05d6c40ab34f69d5404b074 (diff) | |
download | Kamon-002ced85cf207b2aefbcbc496cc6787ef7b844cd.tar.gz Kamon-002ced85cf207b2aefbcbc496cc6787ef7b844cd.tar.bz2 Kamon-002ced85cf207b2aefbcbc496cc6787ef7b844cd.zip |
+ datadog: added counter instument and test
Diffstat (limited to 'kamon-datadog/src/main/scala/kamon/datadog')
-rw-r--r-- | kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala | 9 |
1 files changed, 5 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 9d7b34e6..50911093 100644 --- a/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala +++ b/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala @@ -62,14 +62,15 @@ class DatadogMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long dataBuilder.flush() } + def encodeMeasurement(measurement: Measurement, instrumentType: InstrumentType): String = { - def statsDMetricFormat(value: String, metricType: String, samplingRate: Double = 1D): String = + def dataDogDMetricFormat(value: String, metricType: String, samplingRate: Double = 1D): String = value + "|" + metricType + (if (samplingRate != 1D) "|@" + samplingRateFormat.format(samplingRate) else "") instrumentType match { - case Histogram ⇒ statsDMetricFormat(measurement.value.toString, "ms", (1D / measurement.count)) - case Gauge ⇒ statsDMetricFormat(measurement.value.toString, "g") - case Counter ⇒ "" // TODO: Need to decide how to report counters, when we have them! + case Histogram ⇒ dataDogDMetricFormat(measurement.value.toString, "ms", (1D / measurement.count)) + case Gauge ⇒ dataDogDMetricFormat(measurement.value.toString, "g") + case Counter ⇒ dataDogDMetricFormat(measurement.count.toString, "c") } } } |