Use same timestamp in init
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/72727a5e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/72727a5e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/72727a5e Branch: refs/heads/master Commit: 72727a5e6c5dff570947ceeed849ad939824624c Parents: 1aa03cf Author: Claus Ibsen <davscl...@apache.org> Authored: Sat May 27 15:33:24 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat May 27 15:33:24 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/management/mbean/ManagedCounter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/72727a5e/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCounter.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCounter.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCounter.java index eeb3591..f8fdc86 100644 --- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCounter.java +++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCounter.java @@ -32,8 +32,9 @@ public abstract class ManagedCounter implements ManagedCounterMBean { this.exchangesTotal = new Statistic("org.apache.camel.exchangesTotal", this, Statistic.UpdateMode.COUNTER); this.startTimestamp = new Statistic("org.apache.camel.startTimestamp", this, Statistic.UpdateMode.VALUE); this.resetTimestamp = new Statistic("org.apache.camel.resetTimestamp", this, Statistic.UpdateMode.VALUE); - startTimestamp.updateValue(new Date().getTime()); - resetTimestamp.updateValue(new Date().getTime()); + long now = new Date().getTime(); + startTimestamp.updateValue(now); + resetTimestamp.updateValue(now); } public void reset() {