aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/java/kamon
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2014-08-13 00:13:21 -0400
committerIvan Topolnjak <ivantopo@gmail.com>2014-08-13 00:13:21 -0400
commitcd1e2519140211253120d49c8457e34833c6a3e9 (patch)
tree57d8ea51e5f1c48d0bd5a95a458b76d0ce099fb7 /kamon-core/src/main/java/kamon
parent274c4203931addf82306f7595dbe504daf3a9c94 (diff)
downloadKamon-cd1e2519140211253120d49c8457e34833c6a3e9.tar.gz
Kamon-cd1e2519140211253120d49c8457e34833c6a3e9.tar.bz2
Kamon-cd1e2519140211253120d49c8457e34833c6a3e9.zip
= core: ensure that MinMaxCounters never record values bellow zero, fixes #71
Diffstat (limited to 'kamon-core/src/main/java/kamon')
-rw-r--r--kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java b/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java
index e4ba8807..fc9ea4e5 100644
--- a/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java
+++ b/kamon-core/src/main/java/kamon/jsr166/LongMaxUpdater.java
@@ -114,17 +114,17 @@ public class LongMaxUpdater extends Striped64 implements Serializable {
*
* @return the maximum
*/
- public long maxThenReset() {
+ public long maxThenReset(long newValue) {
Cell[] as = cells;
long max = base;
- base = Long.MIN_VALUE;
+ base = newValue;
if (as != null) {
int n = as.length;
for (int i = 0; i < n; ++i) {
Cell a = as[i];
if (a != null) {
long v = a.value;
- a.value = Long.MIN_VALUE;
+ a.value = newValue;
if (v > max)
max = v;
}