HADOOP-14894. ReflectionUtils should use Time.monotonicNow to mesaure duration. Contributed by Bharat Viswanadham.

This commit is contained in:
Anu Engineer 2017-09-23 11:56:34 -07:00
parent 2a81af447f
commit 1c4a798505
1 changed files with 2 additions and 2 deletions

View File

@ -212,7 +212,7 @@ public static void logThreadInfo(Log log,
boolean dumpStack = false;
if (log.isInfoEnabled()) {
synchronized (ReflectionUtils.class) {
long now = Time.now();
long now = Time.monotonicNow();
if (now - previousLogTime >= minInterval * 1000) {
previousLogTime = now;
dumpStack = true;
@ -241,7 +241,7 @@ public static void logThreadInfo(Logger log,
boolean dumpStack = false;
if (log.isInfoEnabled()) {
synchronized (ReflectionUtils.class) {
long now = Time.now();
long now = Time.monotonicNow();
if (now - previousLogTime >= minInterval * 1000) {
previousLogTime = now;
dumpStack = true;