HADOOP-14894. ReflectionUtils should use Time.monotonicNow to mesaure duration. Contributed by Bharat Viswanadham.
This commit is contained in:
parent
2a81af447f
commit
1c4a798505
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue