From fc22c55f1c5caac4a4921855c30b966722ec8157 Mon Sep 17 00:00:00 2001 From: Diego Date: Sat, 18 Oct 2014 23:57:26 -0300 Subject: ! kamon-newrelic: * Avoid reporting data to Newrelic if no metrics have been collected * Implement error handling with NewRelic Agent * Minor refactor * close issue #7 and issue #17 --- .../src/main/scala/kamon/newrelic/NewRelic.scala | 37 ++++++++++++---------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala') diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala index fd97b2c0..b270d228 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala @@ -1,28 +1,31 @@ -/* =================================================== - * Copyright © 2013 the kamon project +/* + * ========================================================================================= + * Copyright © 2013-2014 the kamon project * - * 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 + * 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 + * 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. - * ========================================================== */ + * 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.newrelic +import java.util.concurrent.TimeUnit.MILLISECONDS + +import akka.actor import akka.actor._ -import kamon.metric.UserMetrics.{ UserGauges, UserMinMaxCounters, UserCounters, UserHistograms } -import scala.concurrent.duration._ import kamon.Kamon -import kamon.metric.{ UserMetrics, TickMetricSnapshotBuffer, TraceMetrics, Metrics } import kamon.metric.Subscriptions.TickMetricSnapshot -import akka.actor -import java.util.concurrent.TimeUnit.MILLISECONDS +import kamon.metric.UserMetrics.{ UserCounters, UserGauges, UserHistograms, UserMinMaxCounters } +import kamon.metric.{ Metrics, TickMetricSnapshotBuffer, TraceMetrics } + +import scala.concurrent.duration._ class NewRelicExtension(system: ExtendedActorSystem) extends Kamon.Extension { val config = system.settings.config.getConfig("kamon.newrelic") -- cgit v1.2.3