diff options
author | hunterpayne-ck <hunter.payne@creditkarma.com> | 2016-12-11 17:08:52 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2016-12-21 19:45:47 -0300 |
commit | 72b9071e57a87478446c48513dcb491426eb9920 (patch) | |
tree | 117a1fa7bf5a81b0ce5222efc2dab347c627c097 /kamon-core/src/test/scala/kamon | |
parent | 48ba951977f2979c4459eee541e98721ab03f5d9 (diff) | |
download | Kamon-72b9071e57a87478446c48513dcb491426eb9920.tar.gz Kamon-72b9071e57a87478446c48513dcb491426eb9920.tar.bz2 Kamon-72b9071e57a87478446c48513dcb491426eb9920.zip |
+ 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)
Diffstat (limited to 'kamon-core/src/test/scala/kamon')
-rw-r--r-- | kamon-core/src/test/scala/kamon/testkit/BaseKamonSpec.scala | 15 |
1 files changed, 8 insertions, 7 deletions
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) |