diff options
author | Boris Giftge <bgiftge@kixeye.com> | 2014-10-22 18:19:15 -0700 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-23 18:53:21 +0200 |
commit | 349b628dc483c7ec6ba4c166e25a5965c0e7d81c (patch) | |
tree | 47ae95aa8b08ad50344d8dbb1ad65ab8a0e1bf31 /kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala | |
parent | 509988c356965e3c4b40bcd4036b7dc573796e1f (diff) | |
download | Kamon-349b628dc483c7ec6ba4c166e25a5965c0e7d81c.tar.gz Kamon-349b628dc483c7ec6ba4c166e25a5965c0e7d81c.tar.bz2 Kamon-349b628dc483c7ec6ba4c166e25a5965c0e7d81c.zip |
= core,system.metrics: fixed serialization errors when using akka.actor.serialize-messages = on
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala b/kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala index bb412f79..d2cb4e38 100644 --- a/kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala +++ b/kamon-core/src/main/scala/kamon/metric/ActorMetrics.scala @@ -69,21 +69,25 @@ object ActorMetrics extends MetricGroupCategory { (Errors -> errors)) } - val Factory = new MetricGroupFactory { - type GroupRecorder = ActorMetricsRecorder + val Factory = ActorMetricGroupFactory +} - def create(config: Config, system: ActorSystem): ActorMetricsRecorder = { - val settings = config.getConfig("precision.actor") +case object ActorMetricGroupFactory extends MetricGroupFactory { + import ActorMetrics._ - val processingTimeConfig = settings.getConfig("processing-time") - val timeInMailboxConfig = settings.getConfig("time-in-mailbox") - val mailboxSizeConfig = settings.getConfig("mailbox-size") + type GroupRecorder = ActorMetricsRecorder - new ActorMetricsRecorder( - Histogram.fromConfig(processingTimeConfig), - Histogram.fromConfig(timeInMailboxConfig), - MinMaxCounter.fromConfig(mailboxSizeConfig, system), - Counter()) - } + def create(config: Config, system: ActorSystem): ActorMetricsRecorder = { + val settings = config.getConfig("precision.actor") + + val processingTimeConfig = settings.getConfig("processing-time") + val timeInMailboxConfig = settings.getConfig("time-in-mailbox") + val mailboxSizeConfig = settings.getConfig("mailbox-size") + + new ActorMetricsRecorder( + Histogram.fromConfig(processingTimeConfig), + Histogram.fromConfig(timeInMailboxConfig), + MinMaxCounter.fromConfig(mailboxSizeConfig, system), + Counter()) } } |