diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-29 02:17:21 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-29 02:17:21 -0300 |
commit | 409843750c596d31ce48b606677b1d5224be3880 (patch) | |
tree | b0d9eaec5f62acc223910ad5deafbac23125700a /kamon-playground | |
parent | 4d336a1d2bd42a84a21e8770d8e0c401f8871aa7 (diff) | |
parent | e83babb5f88e91661bec2f1013fcb6b03612bea9 (diff) | |
download | Kamon-409843750c596d31ce48b606677b1d5224be3880.tar.gz Kamon-409843750c596d31ce48b606677b1d5224be3880.tar.bz2 Kamon-409843750c596d31ce48b606677b1d5224be3880.zip |
Merge branch 'master' into release-0.2
Conflicts:
kamon-core/src/main/scala/kamon/metrics/Subscriptions.scala
kamon-core/src/test/scala/kamon/instrumentation/akka/ActorCellInstrumentationSpec.scala
kamon-datadog/src/main/scala/kamon/datadog/Datadog.scala
kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala
kamon-play/src/test/scala/kamon/play/RequestInstrumentationSpec.scala
kamon-play/src/test/scala/kamon/play/WSInstrumentationSpec.scala
kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala
kamon-statsd/src/main/scala/kamon/statsd/StatsD.scala
project/Projects.scala
version.sbt
Diffstat (limited to 'kamon-playground')
-rw-r--r-- | kamon-playground/src/main/resources/application.conf | 5 | ||||
-rw-r--r-- | kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala | 22 |
2 files changed, 19 insertions, 8 deletions
diff --git a/kamon-playground/src/main/resources/application.conf b/kamon-playground/src/main/resources/application.conf index 3d57141a..bac3c97e 100644 --- a/kamon-playground/src/main/resources/application.conf +++ b/kamon-playground/src/main/resources/application.conf @@ -1,6 +1,7 @@ akka { loglevel = INFO + extensions = ["kamon.logreporter.LogReporter"] actor { debug { @@ -18,13 +19,13 @@ spray.can { kamon { newrelic { app-name = "SimpleRequestProcessor" - license-key = 2e24765acb032cb9e7207013b5ba3e2ab7d2d75c + license-key = e7d350b14228f3d28f35bc3140df2c3e565ea5d5 } } kamon { metrics { - tick-interval = 1 second + tick-interval = 10 second filters = [ { diff --git a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala index 05859ee5..e60a4b2a 100644 --- a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala +++ b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala @@ -26,10 +26,9 @@ import scala.util.Random import akka.routing.RoundRobinRouter import kamon.trace.TraceRecorder import kamon.Kamon -import kamon.metrics._ +import kamon.metric._ import spray.http.{ StatusCodes, Uri } -import kamon.metrics.Subscriptions.TickMetricSnapshot -import kamon.newrelic.WebTransactionMetrics +import kamon.metric.Subscriptions.TickMetricSnapshot object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding with KamonTraceDirectives { import scala.concurrent.duration._ @@ -52,12 +51,23 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil implicit val timeout = Timeout(30 seconds) + val counter = Kamon(UserMetrics).registerCounter("requests") + Kamon(UserMetrics).registerCounter("requests-2") + Kamon(UserMetrics).registerCounter("requests-3") + + Kamon(UserMetrics).registerHistogram("histogram-1") + Kamon(UserMetrics).registerHistogram("histogram-2") + + Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-1") + Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-2") + Kamon(UserMetrics).registerMinMaxCounter("min-max-counter-3") + + //Kamon(UserMetrics).registerGauge("test-gauge")(() => 10L) + val pipeline = sendReceive val replier = system.actorOf(Props[Replier].withRouter(RoundRobinRouter(nrOfInstances = 2)), "replier") val random = new Random() - val requestCountRecorder = Kamon(Metrics).register(CustomMetric("GetCount"), CustomMetric.histogram(10, 3, Scale.Unit)) - startServer(interface = "localhost", port = 9090) { get { path("test") { @@ -88,7 +98,6 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil path("ok") { traceName("OK") { complete { - requestCountRecorder.map(_.record(1)) "ok" } } @@ -96,6 +105,7 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil path("future") { traceName("OK-Future") { dynamic { + counter.increment() complete(Future { "OK" }) } } |