diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-29 03:42:27 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-01-29 03:42:27 +0100 |
commit | a80034229b12d42b420a9b2cc10bf23f8c5f613b (patch) | |
tree | 812d3756ffb1dd74f014a07959c79fd2e651f943 /kamon-playground | |
parent | 1f873f6f28b92db54d97ce82c967866de41008d1 (diff) | |
parent | edceb598dd986c7a0b22f2f89e8dc9f8c0da19e8 (diff) | |
download | Kamon-a80034229b12d42b420a9b2cc10bf23f8c5f613b.tar.gz Kamon-a80034229b12d42b420a9b2cc10bf23f8c5f613b.tar.bz2 Kamon-a80034229b12d42b420a9b2cc10bf23f8c5f613b.zip |
Merge branch 'wip/improve-metric-recorders-infrastructure'
Conflicts:
kamon-system-metrics/src/main/scala/kamon/system/SystemMetricsCollector.scala
Diffstat (limited to 'kamon-playground')
-rw-r--r-- | kamon-playground/src/main/resources/application.conf | 64 | ||||
-rw-r--r-- | kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala | 28 |
2 files changed, 10 insertions, 82 deletions
diff --git a/kamon-playground/src/main/resources/application.conf b/kamon-playground/src/main/resources/application.conf index 9782418f..11f06334 100644 --- a/kamon-playground/src/main/resources/application.conf +++ b/kamon-playground/src/main/resources/application.conf @@ -1,6 +1,6 @@ akka { loglevel = INFO - //extensions = ["kamon.newrelic.NewRelic"] + extensions = ["kamon.statsd.StatsD", "kamon.system.SystemMetrics"] actor { debug { @@ -22,69 +22,15 @@ kamon { } } -kamon.statsd { - hostname = "192.168.59.103" - simple-metric-key-generator { - metric-name-normalization-strategy = percent-encode - } -} - kamon { trace { level = simple-trace - } - metrics { - tick-interval = 1 second - - filters = [ - { - actor { - includes = [ "user/simple-service-actor" ] - excludes = [ "system/*", "user/IO-*" ] - } - }, - { - trace { - includes = [ "*" ] - excludes = [] - } - }, - { - dispatcher { - includes = [ "akka.actor.default-dispatcher" ] - excludes = [] - } - }, - { - custom-metric { - includes = [ "*" ] - excludes = [ ] - } - }, - { - router { - includes = [ "user/replier" ] - excludes = [ "system/*", "user/IO-*" ] - } - } - ] - precision { - actor { - processing-time { - highest-trackable-value = 3600000000000 - significant-value-digits = 1 - } - time-in-mailbox { - highest-trackable-value = 3600000000000 - significant-value-digits = 1 - } - mailbox-size { - highest-trackable-value = 99999999 - significant-value-digits = 1 - } - } + metric { + filters { + trace.includes = [ "**" ] + actor.includes = [ "**" ] } } diff --git a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala index eda02f4e..94c91a8a 100644 --- a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala +++ b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala @@ -20,10 +20,10 @@ import akka.actor._ import akka.routing.RoundRobinPool import akka.util.Timeout import kamon.Kamon -import kamon.metric.Subscriptions.TickMetricSnapshot +import kamon.metric.SubscriptionsDispatcher.TickMetricSnapshot import kamon.metric._ import kamon.spray.KamonTraceDirectives -import kamon.trace.{ Trace, SegmentCategory, TraceRecorder } +import kamon.trace.{ TraceContext, SegmentCategory } import spray.http.{ StatusCodes, Uri } import spray.httpx.RequestBuilding import spray.routing.SimpleRoutingApp @@ -46,27 +46,9 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil def receive: Actor.Receive = { case any ⇒ sender ! any } }), "com") - Kamon(Trace).subscribe(printer) - //val buffer = system.actorOf(TickMetricSnapshotBuffer.props(30 seconds, printer)) - - //Kamon(Metrics).subscribe(CustomMetric, "*", buffer, permanently = true) - //Kamon(Metrics).subscribe(ActorMetrics, "*", printer, permanently = true) - 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 counter = Kamon(UserMetrics).counter("requests") val pipeline = sendReceive val replier = system.actorOf(Props[Replier].withRouter(RoundRobinPool(nrOfInstances = 4)), "replier") @@ -133,7 +115,7 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil } ~ path("segment") { complete { - val segment = TraceRecorder.currentContext.startSegment("hello-world", SegmentCategory.HttpClient, "none") + val segment = TraceContext.currentContext.startSegment("hello-world", SegmentCategory.HttpClient, "none") (replier ? "hello").mapTo[String].onComplete { t ⇒ segment.finish() } @@ -179,7 +161,7 @@ object Verifier extends App { class Replier extends Actor with ActorLogging { def receive = { case anything ⇒ - if (TraceRecorder.currentContext.isEmpty) + if (TraceContext.currentContext.isEmpty) log.warning("PROCESSING A MESSAGE WITHOUT CONTEXT") //log.info("Processing at the Replier, and self is: {}", self) |