diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-29 03:42:27 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-29 03:42:27 +0100 |
commit | 75bd9503aebee628da394a935816991e7a790092 (patch) | |
tree | f4df3333826cec805fadc14894579f1bc1054279 /kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala | |
parent | 61089a75240f5cc21b056087f1d633dd31981c61 (diff) | |
parent | 9839db9d46312435822b6b5faffbbc445af80077 (diff) | |
download | Kamon-75bd9503aebee628da394a935816991e7a790092.tar.gz Kamon-75bd9503aebee628da394a935816991e7a790092.tar.bz2 Kamon-75bd9503aebee628da394a935816991e7a790092.zip |
Merge branch 'wip/improve-metric-recorders-infrastructure'
Conflicts:
kamon-system-metrics/src/main/scala/kamon/system/SystemMetricsCollector.scala
Diffstat (limited to 'kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala | 296 |
1 files changed, 48 insertions, 248 deletions
diff --git a/kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala b/kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala index 6c4fe3fb..a345c6a9 100644 --- a/kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/UserMetricsSpec.scala @@ -1,310 +1,110 @@ package kamon.metric -import akka.actor.{ Props, ActorSystem } -import akka.testkit.{ ImplicitSender, TestKitBase } import com.typesafe.config.ConfigFactory -import kamon.Kamon -import kamon.metric.Subscriptions.TickMetricSnapshot -import kamon.metric.UserMetrics._ -import kamon.metric.instrument.{ Histogram, Counter, MinMaxCounter, Gauge } -import kamon.metric.instrument.Histogram.MutableRecord -import org.scalatest.{ Matchers, WordSpecLike } +import kamon.metric.instrument.Histogram.DynamicRange +import kamon.testkit.BaseKamonSpec import scala.concurrent.duration._ -class UserMetricsSpec extends TestKitBase with WordSpecLike with Matchers with ImplicitSender { - implicit lazy val system: ActorSystem = ActorSystem("actor-metrics-spec", ConfigFactory.parseString( - """ - |kamon.metrics { - | tick-interval = 1 hour - | default-collection-context-buffer-size = 10 - | - | precision { - | default-histogram-precision { - | highest-trackable-value = 10000 - | significant-value-digits = 2 - | } - | - | default-min-max-counter-precision { - | refresh-interval = 1 hour - | highest-trackable-value = 1000 - | significant-value-digits = 2 - | } - | - | default-gauge-precision { - | refresh-interval = 1 hour - | highest-trackable-value = 999999999 - | significant-value-digits = 2 - | } - | } - |} - """.stripMargin)) +class UserMetricsSpec extends BaseKamonSpec("user-metrics-spec") { + override lazy val config = + ConfigFactory.parseString( + """ + |kamon.metric { + | tick-interval = 1 hour + | default-collection-context-buffer-size = 10 + |} + """.stripMargin) "the UserMetrics extension" should { + "allow registering a fully configured Histogram and get the same Histogram if registering again" in { - val histogramA = Kamon(UserMetrics).registerHistogram("histogram-with-settings", Histogram.Precision.Normal, 10000L) - val histogramB = Kamon(UserMetrics).registerHistogram("histogram-with-settings", Histogram.Precision.Normal, 10000L) + val histogramA = kamon.userMetrics.histogram("histogram-with-settings", DynamicRange(1, 10000, 2)) + val histogramB = kamon.userMetrics.histogram("histogram-with-settings", DynamicRange(1, 10000, 2)) histogramA shouldBe theSameInstanceAs(histogramB) } "return the original Histogram when registering a fully configured Histogram for second time but with different settings" in { - val histogramA = Kamon(UserMetrics).registerHistogram("histogram-with-settings", Histogram.Precision.Normal, 10000L) - val histogramB = Kamon(UserMetrics).registerHistogram("histogram-with-settings", Histogram.Precision.Fine, 50000L) + val histogramA = kamon.userMetrics.histogram("histogram-with-settings", DynamicRange(1, 10000, 2)) + val histogramB = kamon.userMetrics.histogram("histogram-with-settings", DynamicRange(1, 50000, 2)) histogramA shouldBe theSameInstanceAs(histogramB) } "allow registering a Histogram that takes the default configuration from the kamon.metrics.precision settings" in { - Kamon(UserMetrics).registerHistogram("histogram-with-default-configuration") + kamon.userMetrics.histogram("histogram-with-default-configuration") } "allow registering a Counter and get the same Counter if registering again" in { - val counterA = Kamon(UserMetrics).registerCounter("counter") - val counterB = Kamon(UserMetrics).registerCounter("counter") + val counterA = kamon.userMetrics.counter("counter") + val counterB = kamon.userMetrics.counter("counter") counterA shouldBe theSameInstanceAs(counterB) } "allow registering a fully configured MinMaxCounter and get the same MinMaxCounter if registering again" in { - val minMaxCounterA = Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-with-settings", Histogram.Precision.Normal, 1000L, 1 second) - val minMaxCounterB = Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-with-settings", Histogram.Precision.Normal, 1000L, 1 second) + val minMaxCounterA = kamon.userMetrics.minMaxCounter("min-max-counter-with-settings", DynamicRange(1, 10000, 2), 1 second) + val minMaxCounterB = kamon.userMetrics.minMaxCounter("min-max-counter-with-settings", DynamicRange(1, 10000, 2), 1 second) minMaxCounterA shouldBe theSameInstanceAs(minMaxCounterB) } "return the original MinMaxCounter when registering a fully configured MinMaxCounter for second time but with different settings" in { - val minMaxCounterA = Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-with-settings", Histogram.Precision.Normal, 1000L, 1 second) - val minMaxCounterB = Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-with-settings", Histogram.Precision.Fine, 5000L, 1 second) + val minMaxCounterA = kamon.userMetrics.minMaxCounter("min-max-counter-with-settings", DynamicRange(1, 10000, 2), 1 second) + val minMaxCounterB = kamon.userMetrics.minMaxCounter("min-max-counter-with-settings", DynamicRange(1, 50000, 2), 1 second) minMaxCounterA shouldBe theSameInstanceAs(minMaxCounterB) } "allow registering a MinMaxCounter that takes the default configuration from the kamon.metrics.precision settings" in { - Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-with-default-configuration") + kamon.userMetrics.minMaxCounter("min-max-counter-with-default-configuration") } "allow registering a fully configured Gauge and get the same Gauge if registering again" in { - val gaugeA = Kamon(UserMetrics).registerGauge("gauge-with-settings", Histogram.Precision.Normal, 1000L, 1 second) { + val gaugeA = kamon.userMetrics.gauge("gauge-with-settings", DynamicRange(1, 10000, 2), 1 second, { () ⇒ 1L - } + }) - val gaugeB = Kamon(UserMetrics).registerGauge("gauge-with-settings", Histogram.Precision.Normal, 1000L, 1 second) { + val gaugeB = kamon.userMetrics.gauge("gauge-with-settings", DynamicRange(1, 10000, 2), 1 second, { () ⇒ 1L - } + }) gaugeA shouldBe theSameInstanceAs(gaugeB) } "return the original Gauge when registering a fully configured Gauge for second time but with different settings" in { - val gaugeA = Kamon(UserMetrics).registerGauge("gauge-with-settings", Histogram.Precision.Normal, 1000L, 1 second) { + val gaugeA = kamon.userMetrics.gauge("gauge-with-settings", DynamicRange(1, 10000, 2), 1 second, { () ⇒ 1L - } + }) - val gaugeB = Kamon(UserMetrics).registerGauge("gauge-with-settings", Histogram.Precision.Fine, 5000L, 1 second) { + val gaugeB = kamon.userMetrics.gauge("gauge-with-settings", DynamicRange(1, 10000, 2), 1 second, { () ⇒ 1L - } + }) gaugeA shouldBe theSameInstanceAs(gaugeB) } "allow registering a Gauge that takes the default configuration from the kamon.metrics.precision settings" in { - Kamon(UserMetrics).registerGauge("gauge-with-default-configuration") { + kamon.userMetrics.gauge("gauge-with-default-configuration", { () ⇒ 2L - } + }) } "allow un-registering user metrics" in { - val metricsExtension = Kamon(Metrics) - Kamon(UserMetrics).registerCounter("counter-for-remove") - Kamon(UserMetrics).registerHistogram("histogram-for-remove") - Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-for-remove") - Kamon(UserMetrics).registerGauge("gauge-for-remove") { () ⇒ 2L } - - metricsExtension.storage.keys should contain(UserCounter("counter-for-remove")) - metricsExtension.storage.keys should contain(UserHistogram("histogram-for-remove")) - metricsExtension.storage.keys should contain(UserMinMaxCounter("min-max-counter-for-remove")) - metricsExtension.storage.keys should contain(UserGauge("gauge-for-remove")) - - Kamon(UserMetrics).removeCounter("counter-for-remove") - Kamon(UserMetrics).removeHistogram("histogram-for-remove") - Kamon(UserMetrics).removeMinMaxCounter("min-max-counter-for-remove") - Kamon(UserMetrics).removeGauge("gauge-for-remove") - - metricsExtension.storage.keys should not contain (UserCounter("counter-for-remove")) - metricsExtension.storage.keys should not contain (UserHistogram("histogram-for-remove")) - metricsExtension.storage.keys should not contain (UserMinMaxCounter("min-max-counter-for-remove")) - metricsExtension.storage.keys should not contain (UserGauge("gauge-for-remove")) - } - - "include all the registered metrics in the a tick snapshot and reset all recorders" in { - Kamon(Metrics).subscribe(UserHistograms, "*", testActor, permanently = true) - Kamon(Metrics).subscribe(UserCounters, "*", testActor, permanently = true) - Kamon(Metrics).subscribe(UserMinMaxCounters, "*", testActor, permanently = true) - Kamon(Metrics).subscribe(UserGauges, "*", testActor, permanently = true) - - val histogramWithSettings = Kamon(UserMetrics).registerHistogram("histogram-with-settings", Histogram.Precision.Normal, 10000L) - val histogramWithDefaultConfiguration = Kamon(UserMetrics).registerHistogram("histogram-with-default-configuration") - val counter = Kamon(UserMetrics).registerCounter("counter") - val minMaxCounterWithSettings = Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-with-settings", Histogram.Precision.Normal, 1000L, 1 second) - val gauge = Kamon(UserMetrics).registerGauge("gauge-with-default-configuration") { () ⇒ 2L } - - // lets put some values on those metrics - histogramWithSettings.record(10) - histogramWithSettings.record(20, 100) - histogramWithDefaultConfiguration.record(40) - - counter.increment() - counter.increment(16) - - minMaxCounterWithSettings.increment(43) - minMaxCounterWithSettings.decrement() - - gauge.record(15) - - Kamon(Metrics).subscriptions ! Subscriptions.FlushMetrics - val firstSnapshot = expectMsgType[TickMetricSnapshot].metrics - - firstSnapshot.keys should contain allOf ( - UserHistogram("histogram-with-settings"), - UserHistogram("histogram-with-default-configuration")) - - firstSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (10) - firstSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (20) - firstSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(101) - firstSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain allOf ( - MutableRecord(10, 1), - MutableRecord(20, 100)) - - firstSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (40) - firstSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (40) - firstSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(1) - firstSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain only ( - MutableRecord(40, 1)) - - firstSnapshot(UserCounter("counter")).metrics(Count).asInstanceOf[Counter.Snapshot].count should be(17) - - firstSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - firstSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (43) - firstSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(3) - firstSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain allOf ( - MutableRecord(0, 1), // min - MutableRecord(42, 1), // current - MutableRecord(43, 1)) // max - - firstSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - firstSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (0) - firstSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(3) - firstSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain only ( - MutableRecord(0, 3)) // min, max and current - - firstSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (15) - firstSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (15) - firstSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(1) - firstSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain only ( - MutableRecord(15, 1)) // only the manually recorded value - - Kamon(Metrics).subscriptions ! Subscriptions.FlushMetrics - val secondSnapshot = expectMsgType[TickMetricSnapshot].metrics - - secondSnapshot.keys should contain allOf ( - UserHistogram("histogram-with-settings"), - UserHistogram("histogram-with-default-configuration")) - - secondSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - secondSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (0) - secondSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(0) - secondSnapshot(UserHistogram("histogram-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream shouldBe empty - - secondSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - secondSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (0) - secondSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(0) - secondSnapshot(UserHistogram("histogram-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream shouldBe empty - - secondSnapshot(UserCounter("counter")).metrics(Count).asInstanceOf[Counter.Snapshot].count should be(0) - - secondSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (42) - secondSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (42) - secondSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(3) - secondSnapshot(UserMinMaxCounter("min-max-counter-with-settings")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain only ( - MutableRecord(42, 3)) // max - - secondSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - secondSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (0) - secondSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(3) - secondSnapshot(UserMinMaxCounter("min-max-counter-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain only ( - MutableRecord(0, 3)) // min, max and current - - secondSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - secondSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (0) - secondSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(0) - secondSnapshot(UserGauge("gauge-with-default-configuration")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream shouldBe empty - - Kamon(Metrics).unsubscribe(testActor) - } - - "generate a snapshot that can be merged with another" in { - val buffer = system.actorOf(TickMetricSnapshotBuffer.props(1 hours, testActor)) - Kamon(Metrics).subscribe(UserHistograms, "*", buffer, permanently = true) - Kamon(Metrics).subscribe(UserCounters, "*", buffer, permanently = true) - Kamon(Metrics).subscribe(UserMinMaxCounters, "*", buffer, permanently = true) - Kamon(Metrics).subscribe(UserGauges, "*", buffer, permanently = true) - - val histogram = Kamon(UserMetrics).registerHistogram("histogram-for-merge") - val counter = Kamon(UserMetrics).registerCounter("counter-for-merge") - val minMaxCounter = Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-for-merge") - val gauge = Kamon(UserMetrics).registerGauge("gauge-for-merge") { () ⇒ 10L } - - histogram.record(100) - counter.increment(10) - minMaxCounter.increment(50) - minMaxCounter.decrement(10) - gauge.record(50) - - Kamon(Metrics).subscriptions ! Subscriptions.FlushMetrics - Thread.sleep(2000) // Make sure that the snapshots are taken before proceeding - - val extraCounter = Kamon(UserMetrics).registerCounter("extra-counter") - histogram.record(200) - extraCounter.increment(20) - minMaxCounter.increment(40) - minMaxCounter.decrement(50) - gauge.record(70) - - Kamon(Metrics).subscriptions ! Subscriptions.FlushMetrics - Thread.sleep(2000) // Make sure that the metrics are buffered. - buffer ! TickMetricSnapshotBuffer.FlushBuffer - val snapshot = expectMsgType[TickMetricSnapshot].metrics - - snapshot.keys should contain(UserHistogram("histogram-for-merge")) - - snapshot(UserHistogram("histogram-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (100) - snapshot(UserHistogram("histogram-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (200) - snapshot(UserHistogram("histogram-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(2) - snapshot(UserHistogram("histogram-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain allOf ( - MutableRecord(100, 1), - MutableRecord(200, 1)) - - snapshot(UserCounter("counter-for-merge")).metrics(Count).asInstanceOf[Counter.Snapshot].count should be(10) - snapshot(UserCounter("extra-counter")).metrics(Count).asInstanceOf[Counter.Snapshot].count should be(20) - - snapshot(UserMinMaxCounter("min-max-counter-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (0) - snapshot(UserMinMaxCounter("min-max-counter-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (80) - snapshot(UserMinMaxCounter("min-max-counter-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(6) - snapshot(UserMinMaxCounter("min-max-counter-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain allOf ( - MutableRecord(0, 1), // min in first snapshot - MutableRecord(30, 2), // min and current in second snapshot - MutableRecord(40, 1), // current in first snapshot - MutableRecord(50, 1), // max in first snapshot - MutableRecord(80, 1)) // max in second snapshot - - snapshot(UserGauge("gauge-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].min shouldBe (50) - snapshot(UserGauge("gauge-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].max shouldBe (70) - snapshot(UserGauge("gauge-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].numberOfMeasurements should be(2) - snapshot(UserGauge("gauge-for-merge")).metrics(RecordedValues).asInstanceOf[Histogram.Snapshot].recordsIterator.toStream should contain allOf ( - MutableRecord(50, 1), - MutableRecord(70, 1)) - - Kamon(Metrics).unsubscribe(testActor) + val counter = kamon.userMetrics.counter("counter-for-remove") + val histogram = kamon.userMetrics.histogram("histogram-for-remove") + val minMaxCounter = kamon.userMetrics.minMaxCounter("min-max-counter-for-remove") + val gauge = kamon.userMetrics.gauge("gauge-for-remove", { () ⇒ 2L }) + + kamon.userMetrics.removeCounter("counter-for-remove") + kamon.userMetrics.removeHistogram("histogram-for-remove") + kamon.userMetrics.removeMinMaxCounter("min-max-counter-for-remove") + kamon.userMetrics.removeGauge("gauge-for-remove") + + counter should not be (theSameInstanceAs(kamon.userMetrics.counter("counter-for-remove"))) + histogram should not be (theSameInstanceAs(kamon.userMetrics.histogram("histogram-for-remove"))) + minMaxCounter should not be (theSameInstanceAs(kamon.userMetrics.minMaxCounter("min-max-counter-for-remove"))) + gauge should not be (theSameInstanceAs(kamon.userMetrics.gauge("gauge-for-remove", { () ⇒ 2L }))) } } } |