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/MinMaxCounterSpec.scala | |
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/MinMaxCounterSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/metric/instrument/MinMaxCounterSpec.scala | 17 |
1 files changed, 11 insertions, 6 deletions
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 { |