This is an automated email from the ASF dual-hosted git repository.

kmarton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/oozie.git


The following commit(s) were added to refs/heads/master by this push:
     new 9bacdfe  OOZIE-3467 Migrate from com.google.common.base.Stopwatch 
(asalamon74 via kmarton)
9bacdfe is described below

commit 9bacdfeaba0f14e1cbe7996d65e8a45475908c8b
Author: Julia Kinga Marton <[email protected]>
AuthorDate: Tue Apr 9 12:17:45 2019 +0200

    OOZIE-3467 Migrate from com.google.common.base.Stopwatch (asalamon74 via 
kmarton)
---
 .../main/java/org/apache/oozie/service/JvmPauseMonitorService.java | 7 +++----
 release-log.txt                                                    | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/core/src/main/java/org/apache/oozie/service/JvmPauseMonitorService.java 
b/core/src/main/java/org/apache/oozie/service/JvmPauseMonitorService.java
index f0c72f3..13b2809 100644
--- a/core/src/main/java/org/apache/oozie/service/JvmPauseMonitorService.java
+++ b/core/src/main/java/org/apache/oozie/service/JvmPauseMonitorService.java
@@ -20,7 +20,6 @@ package org.apache.oozie.service;
 
 import com.google.common.base.Joiner;
 import com.google.common.base.Preconditions;
-import com.google.common.base.Stopwatch;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
@@ -156,16 +155,16 @@ public class JvmPauseMonitorService implements Service {
 
         @Override
         public void run() {
-            Stopwatch sw = new Stopwatch();
             Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes();
             while (shouldRun) {
-                sw.reset().start();
+                long timeBeforeSleep = System.currentTimeMillis();
                 try {
                     Thread.sleep(SLEEP_INTERVAL_MS);
                 } catch (InterruptedException ie) {
                     return;
                 }
-                long extraSleepTime = sw.elapsedMillis() - SLEEP_INTERVAL_MS;
+                long timeAfterSleep = System.currentTimeMillis();
+                long extraSleepTime = timeAfterSleep - timeBeforeSleep - 
SLEEP_INTERVAL_MS;
                 Map<String, GcTimes> gcTimesAfterSleep = getGcTimes();
 
                 if (extraSleepTime > warnThresholdMs) {
diff --git a/release-log.txt b/release-log.txt
index 1a42b66..3bbed8f 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
 -- Oozie 5.2.0 release (trunk - unreleased)
 
+OOZIE-3467 Migrate from com.google.common.base.Stopwatch (asalamon74 via 
kmarton)
 OOZIE-3466 Migrate from com.google.common.io.Closeables to 
org.apache.commons.io.IOUtils (asalamon74 via kmarton)
 OOZIE-3249 [tools] Instrumentation log parser (andras.piros via asalamon74)
 OOZIE-3460 Remove pom files from Oozie sharelibs (nobigo via asalamon74)

Reply via email to