diff options
author | Diego <diegolparra@gmail.com> | 2016-12-04 15:37:51 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2016-12-04 15:37:51 -0300 |
commit | 56039ef037d42cb817d0bc6d5a5891bc87e633c3 (patch) | |
tree | 711d36b49d69f7321ea75172d9d4969e318d7afe /kamon-core/src/test/scala/kamon/metric/instrument | |
parent | e02d137ab960676cb89ff597bc33915f8b83a4d2 (diff) | |
download | Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.tar.gz Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.tar.bz2 Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.zip |
wip
Diffstat (limited to 'kamon-core/src/test/scala/kamon/metric/instrument')
4 files changed, 24 insertions, 19 deletions
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 850200d4..d5d651e5 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/CounterSpec.scala @@ -18,7 +18,7 @@ package kamon.metric.instrument import java.nio.LongBuffer -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.{Matchers, WordSpec} class CounterSpec extends WordSpec with Matchers { diff --git a/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala b/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala index dd60fee1..9551c6ea 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/HistogramSpec.scala @@ -19,7 +19,7 @@ package kamon.metric.instrument import java.nio.LongBuffer import kamon.metric.instrument.Histogram.DynamicRange -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.{Matchers, WordSpec} import scala.util.Random @@ -62,12 +62,12 @@ class HistogramSpec extends WordSpec with Matchers { snapshot.sum should be(41300) snapshot.numberOfMeasurements should be(203) - val records = snapshot.recordsIterator.map(r ⇒ r.level -> r.count).toSeq + val records = snapshot.recordsIterator.map(r ⇒ r.level → r.count).toSeq records.size should be(4) - records(0) should be(100 -> 1) - records(1) should be(200 -> 200) - records(2) should be(300 -> 1) - records(3) should be(900 -> 1) + records(0) should be(100 → 1) + records(1) should be(200 → 200) + records(2) should be(300 → 1) + records(3) should be(900 → 1) } "can be scaled" in new HistogramFixture { @@ -86,12 +86,12 @@ class HistogramSpec extends WordSpec with Matchers { snapshot.sum should be(41300000) snapshot.numberOfMeasurements should be(203) - val records = snapshot.recordsIterator.map(r ⇒ r.level -> r.count).toSeq + val records = snapshot.recordsIterator.map(r ⇒ r.level → r.count).toSeq records.size should be(4) - records(0) should be(100000 -> 1) - records(1) should be(200000 -> 200) - records(2) should be(300000 -> 1) - records(3) should be(900000 -> 1) + records(0) should be(100000 → 1) + records(1) should be(200000 → 200) + records(2) should be(300000 → 1) + records(3) should be(900000 → 1) } "can be merged with another snapshot" in new MultipleHistogramFixture { diff --git a/kamon-core/src/test/scala/kamon/metric/instrument/MinMaxCounterSpec.scala b/kamon-core/src/test/scala/kamon/metric/instrument/MinMaxCounterSpec.scala index 7acfc229..d007d4cd 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/MinMaxCounterSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/MinMaxCounterSpec.scala @@ -20,7 +20,7 @@ import java.nio.LongBuffer import akka.actor._ import akka.testkit.TestProbe import kamon.Kamon -import kamon.metric.instrument.Histogram.{ DynamicRange, MutableRecord } +import kamon.metric.instrument.Histogram.{DynamicRange, MutableRecord} import kamon.testkit.BaseKamonSpec import scala.concurrent.duration._ @@ -38,7 +38,8 @@ class MinMaxCounterSpec extends BaseKamonSpec("min-max-counter-spec") { snapshot.max should be(5) snapshot.recordsIterator.toStream should contain allOf ( MutableRecord(0, 1), // min - MutableRecord(5, 2)) // max and current + MutableRecord(5, 2) + ) // max and current } "track descending tendencies" in new MinMaxCounterFixture { @@ -53,7 +54,8 @@ class MinMaxCounterSpec extends BaseKamonSpec("min-max-counter-spec") { snapshot.max should be(5) snapshot.recordsIterator.toStream should contain allOf ( MutableRecord(0, 2), // min and current - MutableRecord(5, 1)) // max + MutableRecord(5, 1) + ) // max } "reset the min and max to the current value after taking a snapshot" in new MinMaxCounterFixture { @@ -67,14 +69,16 @@ class MinMaxCounterSpec extends BaseKamonSpec("min-max-counter-spec") { firstSnapshot.recordsIterator.toStream should contain allOf ( MutableRecord(0, 1), // min MutableRecord(2, 1), // current - MutableRecord(5, 1)) // max + MutableRecord(5, 1) + ) // max val secondSnapshot = collectCounterSnapshot() secondSnapshot.min should be(2) secondSnapshot.max should be(2) secondSnapshot.recordsIterator.toStream should contain( - MutableRecord(2, 3)) // min, max and current + MutableRecord(2, 3) + ) // min, max and current } "report zero as the min and current values if the current value fell bellow zero" in new MinMaxCounterFixture { @@ -85,7 +89,8 @@ class MinMaxCounterSpec extends BaseKamonSpec("min-max-counter-spec") { snapshot.min should be(0) snapshot.max should be(0) snapshot.recordsIterator.toStream should contain( - MutableRecord(0, 3)) // min, max and current (even while current really is -3 + MutableRecord(0, 3) + ) // min, max and current (even while current really is -3 } "never record values bellow zero in very busy situations" in new MinMaxCounterFixture { diff --git a/kamon-core/src/test/scala/kamon/metric/instrument/UnitOfMeasurementSpec.scala b/kamon-core/src/test/scala/kamon/metric/instrument/UnitOfMeasurementSpec.scala index 10604fe5..7133579e 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/UnitOfMeasurementSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/UnitOfMeasurementSpec.scala @@ -17,7 +17,7 @@ package kamon.metric.instrument import kamon.metric.instrument.UnitOfMeasurement.Unknown -import org.scalatest.{ Matchers, WordSpec } +import org.scalatest.{Matchers, WordSpec} class UnitOfMeasurementSpec extends WordSpec with Matchers { |