diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2013-10-30 09:04:25 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2013-10-30 09:04:25 -0300 |
commit | ca1e93621ddad4b9f2a9028ea183b1c2f4c25a27 (patch) | |
tree | 2f9ce9a7b2f73fd19b5ec2d1af46c4ab43037528 /kamon-metrics | |
parent | ab40e0e7f35f97390d180b49d556ee36aac4af18 (diff) | |
download | Kamon-ca1e93621ddad4b9f2a9028ea183b1c2f4c25a27.tar.gz Kamon-ca1e93621ddad4b9f2a9028ea183b1c2f4c25a27.tar.bz2 Kamon-ca1e93621ddad4b9f2a9028ea183b1c2f4c25a27.zip |
move things all over the place
Diffstat (limited to 'kamon-metrics')
-rw-r--r-- | kamon-metrics/src/main/scala/kamon/Metrics.scala | 15 | ||||
-rw-r--r-- | kamon-metrics/src/test/scala/kamon/MailboxSizeMetricsSpec.scala | 8 |
2 files changed, 20 insertions, 3 deletions
diff --git a/kamon-metrics/src/main/scala/kamon/Metrics.scala b/kamon-metrics/src/main/scala/kamon/Metrics.scala index 2b0e94bd..355c67c7 100644 --- a/kamon-metrics/src/main/scala/kamon/Metrics.scala +++ b/kamon-metrics/src/main/scala/kamon/Metrics.scala @@ -1,7 +1,20 @@ package kamon import com.codahale.metrics.MetricRegistry +import com.typesafe.config.ConfigFactory +import akka.actor.{ActorRef, ExtendedActorSystem, ExtensionIdProvider, ExtensionId} +import kamon.Kamon.Extension +import akka.actor + +class MetricsExtension(system: ExtendedActorSystem) extends Kamon.Extension { + def manager: ActorRef = ??? +} + +object Metrics extends ExtensionId[MetricsExtension] with ExtensionIdProvider { + def lookup(): ExtensionId[_ <: actor.Extension] = Metrics + def createExtension(system: ExtendedActorSystem): Extension = new MetricsExtension(system) -object Metrics { val registry = new MetricRegistry + + } diff --git a/kamon-metrics/src/test/scala/kamon/MailboxSizeMetricsSpec.scala b/kamon-metrics/src/test/scala/kamon/MailboxSizeMetricsSpec.scala index 7cae30f1..206c58e1 100644 --- a/kamon-metrics/src/test/scala/kamon/MailboxSizeMetricsSpec.scala +++ b/kamon-metrics/src/test/scala/kamon/MailboxSizeMetricsSpec.scala @@ -1,12 +1,16 @@ package kamon -import org.scalatest.WordSpec +import org.scalatest.{WordSpecLike, WordSpec} +import akka.testkit.TestKit +import akka.actor.{Props, ActorSystem} -class MailboxSizeMetricsSpec extends WordSpec { +class MailboxSizeMetricsSpec extends TestKit(ActorSystem("mailbox-size-metrics-spec")) with WordSpecLike { "the mailbox size metrics instrumentation" should { "register a counter for mailbox size upon actor creation" in { + val target = system.actorOf(Props.empty, "sample") + Metrics.registry.getHistograms.get("akka://mailbox-size-metrics-spec/sample:MAILBOX") } } } |