aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kamon-newrelic/src/main/scala/kamon/newrelic/package.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/package.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/package.scala
index 06059c49..f6e377c7 100644
--- a/kamon-newrelic/src/main/scala/kamon/newrelic/package.scala
+++ b/kamon-newrelic/src/main/scala/kamon/newrelic/package.scala
@@ -27,12 +27,10 @@ package object newrelic {
val measurementLevels = snapshot.measurements.iterator
while (measurementLevels.hasNext) {
val level = measurementLevels.next()
-
- // NewRelic metrics need to be scaled to seconds.
val scaledValue = Scale.convert(snapshot.scale, scale, level.value)
- total += scaledValue
- sumOfSquares += scaledValue * scaledValue
+ total += scaledValue * level.count
+ sumOfSquares += (scaledValue * scaledValue) * level.count
}
val scaledMin = Scale.convert(snapshot.scale, scale, snapshot.min)