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/DispatcherMetrics.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/DispatcherMetrics.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/DispatcherMetrics.scala | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/DispatcherMetrics.scala b/kamon-core/src/main/scala/kamon/metric/DispatcherMetrics.scala index fbce783c..126f6333 100644 --- a/kamon-core/src/main/scala/kamon/metric/DispatcherMetrics.scala +++ b/kamon-core/src/main/scala/kamon/metric/DispatcherMetrics.scala @@ -66,23 +66,28 @@ object DispatcherMetrics extends MetricGroupCategory { (PoolSize -> poolSize)) } - val Factory = new MetricGroupFactory { - type GroupRecorder = DispatcherMetricRecorder - - def create(config: Config, system: ActorSystem): DispatcherMetricRecorder = { - val settings = config.getConfig("precision.dispatcher") - - val maximumPoolSizeConfig = settings.getConfig("maximum-pool-size") - val runningThreadCountConfig = settings.getConfig("running-thread-count") - val queueTaskCountConfig = settings.getConfig("queued-task-count") - val poolSizeConfig = settings.getConfig("pool-size") - - new DispatcherMetricRecorder( - Histogram.fromConfig(maximumPoolSizeConfig), - Histogram.fromConfig(runningThreadCountConfig), - Histogram.fromConfig(queueTaskCountConfig), - Histogram.fromConfig(poolSizeConfig)) - } - } + val Factory = DispatcherMetricGroupFactory } +case object DispatcherMetricGroupFactory extends MetricGroupFactory { + + import DispatcherMetrics._ + + type GroupRecorder = DispatcherMetricRecorder + + def create(config: Config, system: ActorSystem): DispatcherMetricRecorder = { + val settings = config.getConfig("precision.dispatcher") + + val maximumPoolSizeConfig = settings.getConfig("maximum-pool-size") + val runningThreadCountConfig = settings.getConfig("running-thread-count") + val queueTaskCountConfig = settings.getConfig("queued-task-count") + val poolSizeConfig = settings.getConfig("pool-size") + + new DispatcherMetricRecorder( + Histogram.fromConfig(maximumPoolSizeConfig), + Histogram.fromConfig(runningThreadCountConfig), + Histogram.fromConfig(queueTaskCountConfig), + Histogram.fromConfig(poolSizeConfig)) + } + +} |