aboutsummaryrefslogtreecommitdiff
path: root/kamon-playground
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2014-02-05 01:12:34 -0300
committerIvan Topolnjak <ivantopo@gmail.com>2014-02-05 01:12:34 -0300
commit522a12c90788c402a364407e146d302e6519a3da (patch)
tree3603c2172a8048b5f13c923d85e14b4f8490ca53 /kamon-playground
parent57e433c07a271b4e5e4159500cdc828cd7bb6a83 (diff)
downloadKamon-522a12c90788c402a364407e146d302e6519a3da.tar.gz
Kamon-522a12c90788c402a364407e146d302e6519a3da.tar.bz2
Kamon-522a12c90788c402a364407e146d302e6519a3da.zip
kamon-newrelic now uses the subscription protocol to report metrics to NewRelic
Diffstat (limited to 'kamon-playground')
-rw-r--r--kamon-playground/src/main/resources/application.conf2
-rw-r--r--kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala21
2 files changed, 13 insertions, 10 deletions
diff --git a/kamon-playground/src/main/resources/application.conf b/kamon-playground/src/main/resources/application.conf
index c490c6c2..f0698592 100644
--- a/kamon-playground/src/main/resources/application.conf
+++ b/kamon-playground/src/main/resources/application.conf
@@ -1,6 +1,6 @@
akka {
loggers = [ "akka.event.slf4j.Slf4jLogger" ]
- loglevel = DEBUG
+ loglevel = INFO
extensions = ["kamon.newrelic.NewRelic"]
diff --git a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala
index 06d8795a..c518e32a 100644
--- a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala
+++ b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala
@@ -20,7 +20,7 @@ import spray.routing.SimpleRoutingApp
import akka.util.Timeout
import spray.httpx.RequestBuilding
import scala.concurrent.{ Await, Future }
-import kamon.spray.UowDirectives
+import kamon.spray.KamonTraceDirectives
import scala.util.Random
import akka.routing.RoundRobinRouter
import kamon.trace.TraceRecorder
@@ -30,7 +30,7 @@ import spray.http.{ StatusCodes, Uri }
import kamon.metrics.Subscriptions.TickMetricSnapshot
import kamon.newrelic.WebTransactionMetrics
-object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding with UowDirectives {
+object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding with KamonTraceDirectives {
import scala.concurrent.duration._
import spray.client.pipelining._
import akka.pattern.ask
@@ -57,7 +57,7 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil
startServer(interface = "localhost", port = 9090) {
get {
path("test") {
- uow {
+ traceName("test") {
complete {
val futures = pipeline(Get("http://10.254.209.14:8000/")).map(r ⇒ "Ok") :: pipeline(Get("http://10.254.209.14:8000/")).map(r ⇒ "Ok") :: Nil
@@ -75,21 +75,24 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil
} ~
path("reply" / Segment) { reqID ⇒
- uow {
+ traceName("reply") {
complete {
(replier ? reqID).mapTo[String]
}
}
} ~
path("ok") {
- complete {
- //Thread.sleep(random.nextInt(1) + random.nextInt(5) + random.nextInt(2))
- "ok"
+ traceName("OK") {
+ complete {
+ "ok"
+ }
}
} ~
path("future") {
- dynamic {
- complete(Future { "OK" })
+ traceName("OK-Future") {
+ dynamic {
+ complete(Future { "OK" })
+ }
}
} ~
path("kill") {