diff options
author | Diego <diegolparra@gmail.com> | 2016-12-04 15:37:51 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2016-12-04 15:37:51 -0300 |
commit | 56039ef037d42cb817d0bc6d5a5891bc87e633c3 (patch) | |
tree | 711d36b49d69f7321ea75172d9d4969e318d7afe /kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala | |
parent | e02d137ab960676cb89ff597bc33915f8b83a4d2 (diff) | |
download | Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.tar.gz Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.tar.bz2 Kamon-56039ef037d42cb817d0bc6d5a5891bc87e633c3.zip |
wip
Diffstat (limited to 'kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala b/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala index f7516262..e4d6f547 100644 --- a/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala +++ b/kamon-core/src/main/scala/kamon/metric/instrument/InstrumentSettings.scala @@ -13,8 +13,10 @@ case class InstrumentCustomSettings(lowestDiscernibleValue: Option[Long], highes DynamicRange( lowestDiscernibleValue.getOrElse(that.dynamicRange.lowestDiscernibleValue), highestTrackableValue.getOrElse(that.dynamicRange.highestTrackableValue), - precision.getOrElse(that.dynamicRange.precision)), - refreshInterval.orElse(that.refreshInterval)) + precision.getOrElse(that.dynamicRange.precision) + ), + refreshInterval.orElse(that.refreshInterval) + ) } object InstrumentCustomSettings { @@ -25,7 +27,8 @@ object InstrumentCustomSettings { if (config.hasPath("lowest-discernible-value")) Some(config.getLong("lowest-discernible-value")) else None, if (config.hasPath("highest-trackable-value")) Some(config.getLong("highest-trackable-value")) else None, if (config.hasPath("precision")) Some(InstrumentSettings.parsePrecision(config.getString("precision"))) else None, - if (config.hasPath("refresh-interval")) Some(config.getFiniteDuration("refresh-interval")) else None) + if (config.hasPath("refresh-interval")) Some(config.getFiniteDuration("refresh-interval")) else None + ) } @@ -37,7 +40,8 @@ object InstrumentSettings { DynamicRange( config.getLong("lowest-discernible-value"), config.getLong("highest-trackable-value"), - parsePrecision(config.getString("precision"))) + parsePrecision(config.getString("precision")) + ) def parsePrecision(stringValue: String): Int = stringValue match { case "low" ⇒ 1 @@ -55,10 +59,14 @@ object DefaultInstrumentSettings { import kamon.util.ConfigTools.Syntax val histogramSettings = InstrumentSettings(InstrumentSettings.readDynamicRange(config.getConfig("histogram")), None) - val minMaxCounterSettings = InstrumentSettings(InstrumentSettings.readDynamicRange(config.getConfig("min-max-counter")), - Some(config.getFiniteDuration("min-max-counter.refresh-interval"))) - val gaugeSettings = InstrumentSettings(InstrumentSettings.readDynamicRange(config.getConfig("gauge")), - Some(config.getFiniteDuration("gauge.refresh-interval"))) + val minMaxCounterSettings = InstrumentSettings( + InstrumentSettings.readDynamicRange(config.getConfig("min-max-counter")), + Some(config.getFiniteDuration("min-max-counter.refresh-interval")) + ) + val gaugeSettings = InstrumentSettings( + InstrumentSettings.readDynamicRange(config.getConfig("gauge")), + Some(config.getFiniteDuration("gauge.refresh-interval")) + ) DefaultInstrumentSettings(histogramSettings, minMaxCounterSettings, gaugeSettings) } |