diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-12-05 02:22:25 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-12-05 02:22:25 +0100 |
commit | 355b910f9e7c2e82217ef2443b734e3220752555 (patch) | |
tree | 186090266302e3393d45ef6c2d4eef677fa3caf1 /kamon-core/src/main/scala/kamon/metric/Subscriptions.scala | |
parent | 816503da6a4b28c4739dce518261cc791c7ae81e (diff) | |
download | Kamon-355b910f9e7c2e82217ef2443b734e3220752555.tar.gz Kamon-355b910f9e7c2e82217ef2443b734e3220752555.tar.bz2 Kamon-355b910f9e7c2e82217ef2443b734e3220752555.zip |
+ newrelic: react correctly to restart and shutdown events from the New Relic collector.
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/Subscriptions.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/Subscriptions.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/Subscriptions.scala b/kamon-core/src/main/scala/kamon/metric/Subscriptions.scala index c6571507..a22e1c21 100644 --- a/kamon-core/src/main/scala/kamon/metric/Subscriptions.scala +++ b/kamon-core/src/main/scala/kamon/metric/Subscriptions.scala @@ -21,7 +21,7 @@ import kamon.metric.Subscriptions._ import kamon.util.GlobPathFilter import scala.concurrent.duration.{ FiniteDuration, Duration } import java.util.concurrent.TimeUnit -import kamon.Kamon +import kamon.{ MilliTimestamp, Kamon } import kamon.metric.TickMetricSnapshotBuffer.FlushBuffer class Subscriptions extends Actor { @@ -30,7 +30,7 @@ class Subscriptions extends Actor { val flushMetricsSchedule = scheduleFlushMessage() val collectionContext = Kamon(Metrics).buildDefaultCollectionContext - var lastTick: Long = System.currentTimeMillis() + var lastTick: MilliTimestamp = MilliTimestamp.now var oneShotSubscriptions: Map[ActorRef, MetricSelectionFilter] = Map.empty var permanentSubscriptions: Map[ActorRef, MetricSelectionFilter] = Map.empty @@ -65,7 +65,7 @@ class Subscriptions extends Actor { } def flush(): Unit = { - val currentTick = System.currentTimeMillis() + val currentTick = MilliTimestamp.now val snapshots = collectAll() dispatchSelectedMetrics(lastTick, currentTick, permanentSubscriptions, snapshots) @@ -86,7 +86,7 @@ class Subscriptions extends Actor { builder.result() } - def dispatchSelectedMetrics(lastTick: Long, currentTick: Long, subscriptions: Map[ActorRef, MetricSelectionFilter], + def dispatchSelectedMetrics(lastTick: MilliTimestamp, currentTick: MilliTimestamp, subscriptions: Map[ActorRef, MetricSelectionFilter], snapshots: Map[MetricGroupIdentity, MetricGroupSnapshot]): Unit = { for ((subscriber, filter) ← subscriptions) { @@ -108,7 +108,7 @@ object Subscriptions { case object FlushMetrics case class Unsubscribe(subscriber: ActorRef) case class Subscribe(category: MetricGroupCategory, selection: String, subscriber: ActorRef, permanently: Boolean = false) - case class TickMetricSnapshot(from: Long, to: Long, metrics: Map[MetricGroupIdentity, MetricGroupSnapshot]) + case class TickMetricSnapshot(from: MilliTimestamp, to: MilliTimestamp, metrics: Map[MetricGroupIdentity, MetricGroupSnapshot]) trait MetricSelectionFilter { def accept(identity: MetricGroupIdentity): Boolean |