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 class ReflectionUtils {
boolean dumpStack = false; boolean dumpStack = false;
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
synchronized (ReflectionUtils.class) { synchronized (ReflectionUtils.class) {
long now = Time.now(); long now = Time.monotonicNow();
if (now - previousLogTime >= minInterval * 1000) { if (now - previousLogTime >= minInterval * 1000) {
previousLogTime = now; previousLogTime = now;
dumpStack = true; dumpStack = true;
@ -241,7 +241,7 @@ public class ReflectionUtils {
boolean dumpStack = false; boolean dumpStack = false;
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
synchronized (ReflectionUtils.class) { synchronized (ReflectionUtils.class) {
long now = Time.now(); long now = Time.monotonicNow();
if (now - previousLogTime >= minInterval * 1000) { if (now - previousLogTime >= minInterval * 1000) {
previousLogTime = now; previousLogTime = now;
dumpStack = true; dumpStack = true;