diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-04 01:51:58 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-04 01:51:58 -0300 |
commit | ac2367c8e80bbe6a76f36bd42de9aa9848b0e87b (patch) | |
tree | 15c333bf98222fee71d120585733b963f31ae616 /kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala | |
parent | 8d46b83a5b1c45cf292f3d4d9af362c2c75fd2dc (diff) | |
download | Kamon-ac2367c8e80bbe6a76f36bd42de9aa9848b0e87b.tar.gz Kamon-ac2367c8e80bbe6a76f36bd42de9aa9848b0e87b.tar.bz2 Kamon-ac2367c8e80bbe6a76f36bd42de9aa9848b0e87b.zip |
+ core: introduce the new kamon.metrics.default-collection-context-buffer-size setting
Diffstat (limited to 'kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala b/kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala index b3ff3c9f..9192d999 100644 --- a/kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala +++ b/kamon-core/src/test/scala/kamon/metric/instrument/GaugeSpec.scala @@ -4,15 +4,17 @@ import java.util.concurrent.atomic.AtomicLong import akka.actor.ActorSystem import com.typesafe.config.ConfigFactory -import kamon.metric.{ Scale, CollectionContext } +import kamon.Kamon +import kamon.metric.{ Metrics, Scale, CollectionContext } import org.scalatest.{ Matchers, WordSpecLike } import scala.concurrent.duration._ class GaugeSpec extends WordSpecLike with Matchers { - val system = ActorSystem("gauge-spec", ConfigFactory.parseString( + implicit val system = ActorSystem("gauge-spec", ConfigFactory.parseString( """ |kamon.metrics { | flush-interval = 1 hour + | default-collection-context-buffer-size = 10 | precision { | default-gauge-precision { | refresh-interval = 100 milliseconds @@ -50,7 +52,7 @@ class GaugeSpec extends WordSpecLike with Matchers { Thread.sleep(1.second.toMillis) gauge.cleanup - val snapshot = gauge.collect(CollectionContext.default) + val snapshot = gauge.collect(Kamon(Metrics).buildDefaultCollectionContext) snapshot.numberOfMeasurements should be(10L +- 1L) snapshot.min should be(1) @@ -61,7 +63,7 @@ class GaugeSpec extends WordSpecLike with Matchers { val numberOfValuesRecorded = new AtomicLong(0) val gauge = Gauge(Histogram.Precision.Normal, 10000L, Scale.Unit, 1 hour, system)(() ⇒ numberOfValuesRecorded.addAndGet(1)) - val snapshot = gauge.collect(CollectionContext.default) + val snapshot = gauge.collect(Kamon(Metrics).buildDefaultCollectionContext) snapshot.numberOfMeasurements should be(0) numberOfValuesRecorded.get() should be(0) |