diff options
author | Diego <diegolparra@gmail.com> | 2014-08-09 17:48:37 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-08-09 17:48:37 -0300 |
commit | 274c4203931addf82306f7595dbe504daf3a9c94 (patch) | |
tree | ec043081742d95c9d43fda529aaa2bb00cc9e1cb /kamon-core/src | |
parent | e1c8e0cc6befb1fc4b18cf737295fca009869061 (diff) | |
download | Kamon-274c4203931addf82306f7595dbe504daf3a9c94.tar.gz Kamon-274c4203931addf82306f7595dbe504daf3a9c94.tar.bz2 Kamon-274c4203931addf82306f7595dbe504daf3a9c94.zip |
+ system-metrics: minor load banner refactor
Diffstat (limited to 'kamon-core/src')
-rw-r--r-- | kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java | 8 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/metric/instrument/MinMaxCounter.scala | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java b/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java index 226cd9a1..e4ba8807 100644 --- a/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java +++ b/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java @@ -43,6 +43,14 @@ public class LongMaxUpdater extends Striped64 implements Serializable { } /** + * Creates a new instance with the given initialValue + */ + public LongMaxUpdater(long initialValue) { + base = initialValue; + } + + + /** * Updates the maximum to be at least the given value. * * @param x the value to update diff --git a/kamon-core/src/main/scala/kamon/metric/instrument/MinMaxCounter.scala b/kamon-core/src/main/scala/kamon/metric/instrument/MinMaxCounter.scala index 78828904..13dea8fe 100644 --- a/kamon-core/src/main/scala/kamon/metric/instrument/MinMaxCounter.scala +++ b/kamon-core/src/main/scala/kamon/metric/instrument/MinMaxCounter.scala @@ -63,14 +63,11 @@ object MinMaxCounter { } class PaddedMinMaxCounter(underlyingHistogram: Histogram) extends MinMaxCounter { - private val min = new LongMaxUpdater - private val max = new LongMaxUpdater + private val min = new LongMaxUpdater(0L) + private val max = new LongMaxUpdater(0L) private val sum = new PaddedAtomicLong val refreshValuesSchedule = new AtomicReference[Cancellable]() - min.update(0L) - max.update(0L) - def increment(): Unit = increment(1L) def increment(times: Long): Unit = { |