diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-12 11:30:06 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-02-13 05:15:30 +0100 |
commit | c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8 (patch) | |
tree | d7dbe6a1007b168998f167ac74a98744542c6fa8 /kamon-datadog/src/test/scala | |
parent | 6729c9632245328a007332cdcce7d362584d735a (diff) | |
download | Kamon-c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8.tar.gz Kamon-c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8.tar.bz2 Kamon-c6bb65535bcc3cc1ff3834a91473ee8dfa6145e8.zip |
! all: Kamon now works as a single instance in a companion object.
Diffstat (limited to 'kamon-datadog/src/test/scala')
-rw-r--r-- | kamon-datadog/src/test/scala/kamon/datadog/DatadogMetricSenderSpec.scala | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/kamon-datadog/src/test/scala/kamon/datadog/DatadogMetricSenderSpec.scala b/kamon-datadog/src/test/scala/kamon/datadog/DatadogMetricSenderSpec.scala index 1fcc0c5d..b35902f9 100644 --- a/kamon-datadog/src/test/scala/kamon/datadog/DatadogMetricSenderSpec.scala +++ b/kamon-datadog/src/test/scala/kamon/datadog/DatadogMetricSenderSpec.scala @@ -20,6 +20,7 @@ import akka.testkit.{ TestKitBase, TestProbe } import akka.actor.{ Props, ActorRef, ActorSystem } import kamon.Kamon import kamon.metric.instrument._ +import kamon.testkit.BaseKamonSpec import kamon.util.MilliTimestamp import org.scalatest.{ Matchers, WordSpecLike } import kamon.metric._ @@ -29,22 +30,21 @@ import java.lang.management.ManagementFactory import java.net.InetSocketAddress import com.typesafe.config.ConfigFactory -class DatadogMetricSenderSpec extends TestKitBase with WordSpecLike with Matchers { - implicit lazy val system: ActorSystem = ActorSystem("datadog-metric-sender-spec", ConfigFactory.parseString( - """ - |kamon { - | metrics { - | disable-aspectj-weaver-missing-error = true - | } - | - | datadog { - | max-packet-size = 256 bytes - | } - |} - | - """.stripMargin)) - - val collectionContext = Kamon(Metrics).buildDefaultCollectionContext +class DatadogMetricSenderSpec extends BaseKamonSpec("datadog-metric-sender-spec") { + override lazy val config = + ConfigFactory.parseString( + """ + |kamon { + | metrics { + | disable-aspectj-weaver-missing-error = true + | } + | + | datadog { + | max-packet-size = 256 bytes + | } + |} + | + """.stripMargin) "the DataDogMetricSender" should { "send latency measurements" in new UdpListenerFixture { @@ -106,7 +106,7 @@ class DatadogMetricSenderSpec extends TestKitBase with WordSpecLike with Matcher val testMaxPacketSize = system.settings.config.getBytes("kamon.datadog.max-packet-size") def buildRecorder(name: String): (Entity, TestEntityRecorder) = { - val registration = Kamon(Metrics).register(TestEntityRecorder, name).get + val registration = Kamon.metrics.register(TestEntityRecorder, name).get (registration.entity, registration.recorder) } |