From 72b9071e57a87478446c48513dcb491426eb9920 Mon Sep 17 00:00:00 2001 From: hunterpayne-ck Date: Sun, 11 Dec 2016 17:08:52 -0300 Subject: + core: adding back a method to allow passing of a configuration into kamon * more-flexible-kamon-config: adding back a method to allow passing of a configuration into kamon but still allows for kamon's internal config to control the actor system responsible for metrics (cherry picked from commit 1734c2b) --- .../src/test/scala/kamon/testkit/BaseKamonSpec.scala | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'kamon-core/src/test') diff --git a/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala b/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala index d2e569ad..b11acbb3 100644 --- a/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala +++ b/kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala @@ -17,23 +17,24 @@ package kamon.testkit import akka.actor.ActorSystem -import akka.testkit.{ImplicitSender, TestKitBase} +import akka.testkit.{ ImplicitSender, TestKitBase } import com.typesafe.config.Config import kamon.Kamon -import kamon.metric.{Entity, EntitySnapshot, SubscriptionsDispatcher} +import kamon.metric.{ Entity, EntitySnapshot, SubscriptionsDispatcher } import kamon.trace.TraceContext import kamon.util.LazyActorRef -import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike} +import org.scalatest.{ BeforeAndAfterAll, Matchers, WordSpecLike } abstract class BaseKamonSpec(actorSystemName: String) extends TestKitBase with WordSpecLike with Matchers with ImplicitSender with BeforeAndAfterAll { lazy val collectionContext = Kamon.metrics.buildDefaultCollectionContext implicit lazy val system: ActorSystem = { - Kamon.start() - ActorSystem(actorSystemName, config) + Kamon.start(mergedConfig) + ActorSystem(actorSystemName, mergedConfig) } - def config: Config = - Kamon.config + def config: Config = Kamon.defaultConfig + + def mergedConfig: Config = config.withFallback(Kamon.defaultConfig) def newContext(name: String): TraceContext = Kamon.tracer.newContext(name) -- cgit v1.2.3