diff options
author | Diego <diegolparra@gmail.com> | 2015-05-23 22:15:14 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2015-05-23 22:15:14 -0300 |
commit | 2ac406321b056a7e79856516db9594f4872ab33e (patch) | |
tree | d104321a1e1fac5051ef36fb106414c88f0a9cb3 /kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala | |
parent | 58919a59acd867bc919cbbb24d13613f666f9add (diff) | |
download | Kamon-2ac406321b056a7e79856516db9594f4872ab33e.tar.gz Kamon-2ac406321b056a7e79856516db9594f4872ab33e.tar.bz2 Kamon-2ac406321b056a7e79856516db9594f4872ab33e.zip |
! all: remove kamon-dashboard module
Diffstat (limited to 'kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala')
-rw-r--r-- | kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala b/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala deleted file mode 100644 index f02bd31f..00000000 --- a/kamon-dashboard/src/main/scala/kamon/dashboard/DashboardService.scala +++ /dev/null @@ -1,101 +0,0 @@ -/* =================================================== - * Copyright © 2013 the kamon project <http://kamon.io/> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ -package kamon.dashboard - -import spray.routing.HttpService -import akka.actor._ -import spray.routing.directives.LogEntry -import akka.event.Logging -import spray.http.MediaTypes._ -import spray.httpx.SprayJsonSupport -import spray.http.HttpRequest -import akka.actor.OneForOneStrategy - -class DashboardServiceActor extends Actor with DashboardService { - - def actorRefFactory = context - def receive = runRoute(DashboardRoute) - - override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() { case _ ⇒ SupervisorStrategy.Stop } -} - -trait DashboardService extends HttpService with StaticResources with DashboardPages with DashboardMetricsApi { - - def showPath(req: HttpRequest) = LogEntry(s"Method = ${req.method}, Path = ${req.uri}", Logging.InfoLevel) - - val DashboardRoute = - logRequest(showPath _) { - staticResources ~ dashboardPages //~ dashboardMetricsApi - } -} - -trait StaticResources extends HttpService { - - val staticResources = get { getFromResourceDirectory("web") } -} - -trait DashboardPages extends HttpService { - - val dashboardPages = - path("") { - respondWithMediaType(`text/html`) { - getFromResource("web/index.html") - } - } -} - -trait DashboardMetricsApi extends HttpService with SprayJsonSupport { - - /*import scala.collection.JavaConverters._ - import kamon.metric.Metrics._ - import kamon.dashboard.protocol.DashboardProtocols._ - - val metricFilter = new MetricFilter() { - def matches(name: String, m:Metric) = { - !name.contains("kamon") && name.contains("Mailbox/PROCESSINGTIME") && !name.contains("UnhandledMessageForwarder") && !name.contains("deadLetterListener") && !name.contains("$DefaultLogger") - } - } - - def actorSystemMetrics = actorSystemNames.flatMap(name => actorSystem(name)) - .map(system => ActorSystemMetricsHolder(system.actorSystemName, system.dispatchers.map { case(name, metricCollector) => (name -> DispatcherMetricCollectorHolder(name, metricCollector.activeThreadCount.snapshot.median, metricCollector.poolSize.snapshot.median, metricCollector.queueSize.snapshot.median))}.toMap)) - - val withTotalMessages = (dataHolders: Seq[TimerDataHolder]) => { - val numberOfMessages = dataHolders.map(_.count).sum - - new TotalMessages(numberOfMessages, dataHolders.size, dataHolders) - } - - def timerMetrics = registry.getTimers(metricFilter).asScala.map{ case(name, timer) => TimerDataHolder(name, timer.getMeanRate, timer.getSnapshot.get99thPercentile)}.toVector - - val dashboardMetricsApi = - pathPrefix("metrics") { - path("dispatchers") { - get { - complete (actorSystemMetrics) - } - } ~ - path("messages") { - get { - complete (withTotalMessages(timerMetrics)) - } - } ~ - path("actorTree") { - get { - complete (ActorTree("/", ActorTree("Pang", ActorTree("Pang-children") :: Nil) :: ActorTree("Ping") :: ActorTree("Pong", ActorTree("Pong-children") :: Nil):: Nil)) - } - } - }*/ -}
\ No newline at end of file |