From da316898d4fd99407b250ac9abb4de1de3b88dc2 Mon Sep 17 00:00:00 2001 From: Eugene Platonov Date: Tue, 1 Dec 2015 13:26:50 -0500 Subject: + core: provide generic way to scale time and memory metrics --- .../src/test/scala/kamon/metric/instrument/CounterSpec.scala | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala') diff --git a/kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala b/kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala index 094baf4c..850200d4 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala @@ -56,6 +56,15 @@ class CounterSpec extends WordSpec with Matchers { counterBSnapshot.merge(counterASnapshot, collectionContext).count should be(300) } + "produce a snapshot that can be scaled" in new CounterFixture { + counter.increment(100) + + val counterSnapshot = takeSnapshotFrom(counter) + + val scaledSnapshot = counterSnapshot.scale(Time.Milliseconds, Time.Microseconds) + scaledSnapshot.count should be(100000) + } + } trait CounterFixture { -- cgit v1.2.3