diff options
Diffstat (limited to 'kamon-newrelic/src/main/scala/kamon/newrelic')
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/Agent.scala | 2 | ||||
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/Agent.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/Agent.scala index 299773e4..9c4075eb 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/Agent.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/Agent.scala @@ -79,7 +79,7 @@ class Agent extends Actor with RequestBuilding with ResponseTransformation with val compressedPipeline: HttpRequest ⇒ Future[HttpResponse] = encode(Deflate) ~> sendReceive val compressedToJsonPipeline: HttpRequest ⇒ Future[JsValue] = compressedPipeline ~> toJson - def toJson(response: HttpResponse): JsValue = response.entity.asString.asJson + def toJson(response: HttpResponse): JsValue = response.entity.asString.parseJson def selectCollector: Future[String] = { val query = ("method" -> "get_redirect_host") +: baseQuery diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala index 63aa147b..c195ed12 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala @@ -21,12 +21,13 @@ import kamon.Kamon import kamon.metrics.{ CustomMetric, TickMetricSnapshotBuffer, TraceMetrics, Metrics } import kamon.metrics.Subscriptions.TickMetricSnapshot import akka.actor +import java.util.concurrent.TimeUnit.MILLISECONDS class NewRelicExtension(system: ExtendedActorSystem) extends Kamon.Extension { val config = system.settings.config.getConfig("kamon.newrelic") val metricsListener = system.actorOf(Props[NewRelicMetricsListener], "kamon-newrelic") - val apdexT: Double = config.getMilliseconds("apdexT") / 1E3 // scale to seconds. + val apdexT: Double = config.getDuration("apdexT", MILLISECONDS) / 1E3 // scale to seconds. Kamon(Metrics)(system).subscribe(TraceMetrics, "*", metricsListener, permanently = true) Kamon(Metrics)(system).subscribe(CustomMetric, "*", metricsListener, permanently = true) |