diff options
author | Diego <diegolparra@gmail.com> | 2014-10-26 17:16:45 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-10-26 17:16:45 -0300 |
commit | ff618be49e761b7b646c70f56909e715ecf86a00 (patch) | |
tree | fc9e49c6985a9f90df7275ecd978b5e108f9e387 /kamon-system-metrics/src/main/scala/kamon | |
parent | 3e2c2b3ba39ad8cca4874e3be3004f8a182dab36 (diff) | |
download | Kamon-ff618be49e761b7b646c70f56909e715ecf86a00.tar.gz Kamon-ff618be49e761b7b646c70f56909e715ecf86a00.tar.bz2 Kamon-ff618be49e761b7b646c70f56909e715ecf86a00.zip |
= system-metrics: make ContextSwitchesMetrics serializable
Diffstat (limited to 'kamon-system-metrics/src/main/scala/kamon')
-rw-r--r-- | kamon-system-metrics/src/main/scala/kamon/metrics/ContextSwitchesMetrics.scala | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/kamon-system-metrics/src/main/scala/kamon/metrics/ContextSwitchesMetrics.scala b/kamon-system-metrics/src/main/scala/kamon/metrics/ContextSwitchesMetrics.scala index a38b114c..86aeabce 100644 --- a/kamon-system-metrics/src/main/scala/kamon/metrics/ContextSwitchesMetrics.scala +++ b/kamon-system-metrics/src/main/scala/kamon/metrics/ContextSwitchesMetrics.scala @@ -57,22 +57,25 @@ object ContextSwitchesMetrics extends MetricGroupCategory { Global -> global) } - val Factory = new MetricGroupFactory { + val Factory = ContextSwitchesMetricGroupFactory +} - type GroupRecorder = ContextSwitchesMetricsRecorder +case object ContextSwitchesMetricGroupFactory extends MetricGroupFactory { + import ContextSwitchesMetrics._ - def create(config: Config, system: ActorSystem): GroupRecorder = { - val settings = config.getConfig("precision.system.context-switches") + type GroupRecorder = ContextSwitchesMetricsRecorder - val perProcessVoluntary = settings.getConfig("per-process-voluntary") - val perProcessNonVoluntary = settings.getConfig("per-process-non-voluntary") - val global = settings.getConfig("global") + def create(config: Config, system: ActorSystem): GroupRecorder = { + val settings = config.getConfig("precision.system.context-switches") - new ContextSwitchesMetricsRecorder( - Histogram.fromConfig(perProcessVoluntary), - Histogram.fromConfig(perProcessNonVoluntary), - Histogram.fromConfig(global)) - } + val perProcessVoluntary = settings.getConfig("per-process-voluntary") + val perProcessNonVoluntary = settings.getConfig("per-process-non-voluntary") + val global = settings.getConfig("global") + + new ContextSwitchesMetricsRecorder( + Histogram.fromConfig(perProcessVoluntary), + Histogram.fromConfig(perProcessNonVoluntary), + Histogram.fromConfig(global)) } } |