diff options
Diffstat (limited to 'kamon-dashboard/src/main/scala')
3 files changed, 16 insertions, 17 deletions
diff --git a/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardExtension.scala b/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardExtension.scala index a2b9080c..97716a3f 100644 --- a/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardExtension.scala +++ b/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardExtension.scala @@ -25,15 +25,15 @@ object DashboardExtension extends ExtensionId[DashboardExtensionImpl] with Exten } class DashboardExtensionImpl(system: ExtendedActorSystem) extends Extension { - if("kamon".equalsIgnoreCase(system.name)) { + if ("kamon".equalsIgnoreCase(system.name)) { val enabled = system.settings.config getBoolean "dashboard.enabled" val interface = system.settings.config getString "dashboard.interface" - val port = system.settings.config getInt "dashboard.port" + val port = system.settings.config getInt "dashboard.port" - if(enabled){ - val service = system.actorOf(Props[DashboardServiceActor], "kamon-dashboard-service") - IO(Http)(system) ! Http.Bind(service, interface, port) + if (enabled) { + val service = system.actorOf(Props[DashboardServiceActor], "kamon-dashboard-service") + IO(Http)(system) ! Http.Bind(service, interface, port) } } }
\ No newline at end of file diff --git a/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala b/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala index 59ca4339..d092a947 100644 --- a/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala +++ b/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala @@ -24,15 +24,14 @@ import spray.httpx.SprayJsonSupport import kamon.Kamon import spray.http.HttpRequest import akka.actor.OneForOneStrategy -import com.codahale.metrics.{Metric, MetricFilter} - +import com.codahale.metrics.{ Metric, MetricFilter } class DashboardServiceActor extends Actor with DashboardService { def actorRefFactory = context def receive = runRoute(DashboardRoute) - override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() { case _ => SupervisorStrategy.Stop } + override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() { case _ ⇒ SupervisorStrategy.Stop } } trait DashboardService extends HttpService with StaticResources with DashboardPages with DashboardMetricsApi { @@ -47,7 +46,7 @@ trait DashboardService extends HttpService with StaticResources with DashboardPa trait StaticResources extends HttpService { - val staticResources = get { getFromResourceDirectory("web")} + val staticResources = get { getFromResourceDirectory("web") } } trait DashboardPages extends HttpService { @@ -60,7 +59,7 @@ trait DashboardPages extends HttpService { } } -trait DashboardMetricsApi extends HttpService with SprayJsonSupport{ +trait DashboardMetricsApi extends HttpService with SprayJsonSupport { /*import scala.collection.JavaConverters._ import kamon.metric.Metrics._ diff --git a/kamon-dashboard/src/main/scala/kamon/dashboard/protocol/DashboardProtocols.scala b/kamon-dashboard/src/main/scala/kamon/dashboard/protocol/DashboardProtocols.scala index 2e523ca2..a27e23bf 100644 --- a/kamon-dashboard/src/main/scala/kamon/dashboard/protocol/DashboardProtocols.scala +++ b/kamon-dashboard/src/main/scala/kamon/dashboard/protocol/DashboardProtocols.scala @@ -15,15 +15,15 @@ * ========================================================== */ package kamon.dashboard.protocol -import spray.json.{RootJsonFormat, DefaultJsonProtocol} +import spray.json.{ RootJsonFormat, DefaultJsonProtocol } object DashboardProtocols { - case class TimerDataHolder(name:String, count:Double, percentile99:Double) - case class TotalMessages(messages:Double, actors:Long, data:Seq[TimerDataHolder]) - case class DispatcherMetricCollectorHolder(name:String, activeThreadCount: Double, poolSize: Double, queueSize:Double) - case class ActorSystemMetricsHolder(actorSystem:String, dispatchers:Map[String, DispatcherMetricCollectorHolder]) - case class ActorTree(name:String, children:List[ActorTree] = Nil) + case class TimerDataHolder(name: String, count: Double, percentile99: Double) + case class TotalMessages(messages: Double, actors: Long, data: Seq[TimerDataHolder]) + case class DispatcherMetricCollectorHolder(name: String, activeThreadCount: Double, poolSize: Double, queueSize: Double) + case class ActorSystemMetricsHolder(actorSystem: String, dispatchers: Map[String, DispatcherMetricCollectorHolder]) + case class ActorTree(name: String, children: List[ActorTree] = Nil) object TimerDataHolder extends DefaultJsonProtocol { implicit val TimerDataHolderJsonProtocol = jsonFormat3(apply) @@ -42,6 +42,6 @@ object DashboardProtocols { } object ActorTree extends DefaultJsonProtocol { - implicit val ActorTreeJsonProtocol:RootJsonFormat[ActorTree] = rootFormat(lazyFormat(jsonFormat(apply, "name", "children"))) + implicit val ActorTreeJsonProtocol: RootJsonFormat[ActorTree] = rootFormat(lazyFormat(jsonFormat(apply, "name", "children"))) } } |