diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-01-28 01:25:51 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-01-28 01:25:51 -0300 |
commit | e31ed96edbdf61ea0e20e879ec013400f4ef17ec (patch) | |
tree | 735f8c132ba7187b20e11856f9bc97b570970972 /kamon-core/src/test/scala/kamon | |
parent | 966ba65ee12bdc60b231d421ab9d31b7c050b630 (diff) | |
download | Kamon-e31ed96edbdf61ea0e20e879ec013400f4ef17ec.tar.gz Kamon-e31ed96edbdf61ea0e20e879ec013400f4ef17ec.tar.bz2 Kamon-e31ed96edbdf61ea0e20e879ec013400f4ef17ec.zip |
store actor metrics in the new metrics extension
Diffstat (limited to 'kamon-core/src/test/scala/kamon')
-rw-r--r-- | kamon-core/src/test/scala/kamon/metrics/ActorMetricsSpec.scala | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/kamon-core/src/test/scala/kamon/metrics/ActorMetricsSpec.scala b/kamon-core/src/test/scala/kamon/metrics/ActorMetricsSpec.scala index 127de4c4..91fb3a69 100644 --- a/kamon-core/src/test/scala/kamon/metrics/ActorMetricsSpec.scala +++ b/kamon-core/src/test/scala/kamon/metrics/ActorMetricsSpec.scala @@ -16,36 +16,43 @@ package kamon.metrics -import org.scalatest.{ WordSpecLike, Matchers, WordSpec } +import org.scalatest.{ WordSpecLike, Matchers } import akka.testkit.TestKitBase import akka.actor.{ Actor, Props, ActorSystem } import com.typesafe.config.ConfigFactory -import kamon.Kamon -import kamon.metrics.ActorMetricsDispatcher.{ ActorMetricsSnapshot, Subscribe } import scala.concurrent.duration._ +import kamon.Kamon +import kamon.metrics.Subscriptions.TickMetricSnapshot class ActorMetricsSpec extends TestKitBase with WordSpecLike with Matchers { implicit lazy val system: ActorSystem = ActorSystem("actor-metrics-spec", ConfigFactory.parseString( """ - |kamon.metrics.actors.tracked = ["user/test*"] - """.stripMargin)) + |kamon.metrics { + | filters = [ + | { + | actor { + | includes = [ "user/*" ] + | excludes = [ ] + | } + | } + | ] + |} + """.stripMargin)) - implicit def self = testActor - - lazy val metricsExtension = Actor.noSender "the Kamon actor metrics" should { "track configured actors" in { - system.actorOf(Props[Other], "test-tracked-actor") ! "nothing" - metricsExtension ! Subscribe("user/test-tracked-actor") + Kamon(Metrics).subscribe(ActorMetrics, "user/test-tracked-actor", testActor) + + system.actorOf(Props[Discard], "test-tracked-actor") ! "nothing" - within(5 seconds) { - expectMsgType[ActorMetricsDispatcher.ActorMetricsSnapshot] - } + println(within(5 seconds) { + expectMsgType[TickMetricSnapshot] + }) } } } -class Other extends Actor { +class Discard extends Actor { def receive = { case a ⇒ } } |