diff options
author | Diego <diegolparra@gmail.com> | 2014-05-01 19:49:22 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-05-01 19:49:22 -0300 |
commit | 80f8a5d0b3a6c936453645254c1349b9691b1df2 (patch) | |
tree | ada6f152bef39a3dacbd32d3cf56eef1bdbc0984 /kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala | |
parent | b260e19fac6fc85822c53abc4688e90b6166a0af (diff) | |
download | Kamon-80f8a5d0b3a6c936453645254c1349b9691b1df2.tar.gz Kamon-80f8a5d0b3a6c936453645254c1349b9691b1df2.tar.bz2 Kamon-80f8a5d0b3a6c936453645254c1349b9691b1df2.zip |
! core: first implementetion of kamon counter intrument and actor errors metrics
Diffstat (limited to 'kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala b/kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala index b4f33ec3..4d6ebc49 100644 --- a/kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala +++ b/kamon-core/src/test/scala/kamon/metrics/MetricSnapshotSpec.scala @@ -25,25 +25,28 @@ class MetricSnapshotSpec extends WordSpec with Matchers { "support a max operation" in new SnapshotFixtures { snapshotA.max should be(17) snapshotB.max should be(10) + snapshotC.max should be(1) } "support a min operation" in new SnapshotFixtures { snapshotA.min should be(1) snapshotB.min should be(2) + snapshotC.min should be(1) } "be able to merge with other snapshot" in new SnapshotFixtures { - val merged = snapshotA.merge(snapshotB) + val merged = snapshotA.merge(snapshotB).merge(snapshotC) merged.min should be(1) merged.max should be(17) - merged.numberOfMeasurements should be(200) + merged.numberOfMeasurements should be(300) merged.measurements.map(_.value) should contain inOrderOnly (1, 2, 4, 5, 7, 10, 17) } "be able to merge with empty snapshots" in new SnapshotFixtures { snapshotA.merge(emptySnapshot) should be(snapshotA) emptySnapshot.merge(snapshotA).merge(emptySnapshot) should be(snapshotA) + snapshotC.merge(emptySnapshot) should be(snapshotC) } } @@ -63,5 +66,7 @@ class MetricSnapshotSpec extends WordSpec with Matchers { Measurement(4, 48), Measurement(5, 39), Measurement(10, 7))) + + val snapshotC = MetricSnapshot(InstrumentTypes.Counter, 100, Scale.Unit, Vector(Measurement(1, 100))) } } |