diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-27 19:09:40 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-27 19:09:40 -0300 |
commit | b6ea0a93e6be8e1f355f1bc993618d178d0c9372 (patch) | |
tree | a7d03a385e13df146df871f2a66c8f70eed8bc84 /kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala | |
parent | 003af1dd8ef1e3b4a8f1a9eff56a3c15c01cb2a9 (diff) | |
download | Kamon-b6ea0a93e6be8e1f355f1bc993618d178d0c9372.tar.gz Kamon-b6ea0a93e6be8e1f355f1bc993618d178d0c9372.tar.bz2 Kamon-b6ea0a93e6be8e1f355f1bc993618d178d0c9372.zip |
first implementation of a universal metrics repository for any kind of metrics we might be interested in
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala b/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala index 4a6c98f4..0e3af5fd 100644 --- a/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala +++ b/kamon-core/src/main/scala/kamon/metrics/ActorMetricsOps.scala @@ -16,7 +16,7 @@ package kamon.metrics -import org.HdrHistogram.{ AbstractHistogram, AtomicHistogram } +import org.HdrHistogram.{ HighDynamicRangeRecorder, AbstractHistogram, AtomicHistogram } import kamon.util.GlobPathFilter import scala.collection.concurrent.TrieMap import scala.collection.JavaConversions.iterableAsScalaIterable @@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit import kamon.metrics.ActorMetricsDispatcher.Subscribe trait ActorMetricsOps { - self: ActorMetricsExtension ⇒ + self: MetricsExtension ⇒ val config = system.settings.config.getConfig("kamon.metrics.actors") val actorMetrics = TrieMap[String, HdrActorMetricsRecorder]() @@ -38,9 +38,9 @@ trait ActorMetricsOps { val actorMetricsFactory: () ⇒ HdrActorMetricsRecorder = { val settings = config.getConfig("hdr-settings") - val processingTimeHdrConfig = HdrConfiguration.fromConfig(settings.getConfig("processing-time")) - val timeInMailboxHdrConfig = HdrConfiguration.fromConfig(settings.getConfig("time-in-mailbox")) - val mailboxSizeHdrConfig = HdrConfiguration.fromConfig(settings.getConfig("mailbox-size")) + val processingTimeHdrConfig = HighDynamicRangeRecorder.Configuration.fromConfig(settings.getConfig("processing-time")) + val timeInMailboxHdrConfig = HighDynamicRangeRecorder.Configuration.fromConfig(settings.getConfig("time-in-mailbox")) + val mailboxSizeHdrConfig = HighDynamicRangeRecorder.Configuration.fromConfig(settings.getConfig("mailbox-size")) () ⇒ new HdrActorMetricsRecorder(processingTimeHdrConfig, timeInMailboxHdrConfig, mailboxSizeHdrConfig) } @@ -53,8 +53,8 @@ trait ActorMetricsOps { def unregisterActor(path: String): Unit = actorMetrics.remove(path) } -class HdrActorMetricsRecorder(processingTimeHdrConfig: HdrConfiguration, timeInMailboxHdrConfig: HdrConfiguration, - mailboxSizeHdrConfig: HdrConfiguration) { +class HdrActorMetricsRecorder(processingTimeHdrConfig: HighDynamicRangeRecorder.Configuration, timeInMailboxHdrConfig: HighDynamicRangeRecorder.Configuration, + mailboxSizeHdrConfig: HighDynamicRangeRecorder.Configuration) { val processingTimeHistogram = new AtomicHistogram(processingTimeHdrConfig.highestTrackableValue, processingTimeHdrConfig.significantValueDigits) val timeInMailboxHistogram = new AtomicHistogram(timeInMailboxHdrConfig.highestTrackableValue, timeInMailboxHdrConfig.significantValueDigits) @@ -103,8 +103,8 @@ class ActorMetricsDispatcher extends Actor { } def flushMetrics(): Unit = { - val currentTick = System.currentTimeMillis() - val snapshots = Kamon(ActorMetrics)(context.system).actorMetrics.map { + /* val currentTick = System.currentTimeMillis() + val snapshots = Kamon(Metrics)(context.system).actorMetrics.map { case (path, metrics) ⇒ val snapshot = metrics.snapshot() metrics.reset() @@ -116,7 +116,7 @@ class ActorMetricsDispatcher extends Actor { dispatchMetricsTo(subscribedForever, snapshots, currentTick) subscribedForOne = Map.empty - lastTick = currentTick + lastTick = currentTick*/ } def dispatchMetricsTo(subscribers: Map[GlobPathFilter, List[ActorRef]], snapshots: Map[String, HdrActorMetricsSnapshot], |