|
@@ -150,23 +150,23 @@ public class InstrumentedLock implements Lock {
|
|
|
|
|
|
@VisibleForTesting
|
|
|
void logWarning(long lockHeldTime, SuppressedSnapshot stats) {
|
|
|
- logger.warn(String.format("Lock held time above threshold: " +
|
|
|
+ logger.warn(String.format("Lock held time above threshold(%d ms): " +
|
|
|
"lock identifier: %s " +
|
|
|
"lockHeldTimeMs=%d ms. Suppressed %d lock warnings. " +
|
|
|
"Longest suppressed LockHeldTimeMs=%d. " +
|
|
|
"The stack trace is: %s" ,
|
|
|
- name, lockHeldTime, stats.getSuppressedCount(),
|
|
|
+ lockWarningThreshold, name, lockHeldTime, stats.getSuppressedCount(),
|
|
|
stats.getMaxSuppressedWait(),
|
|
|
StringUtils.getStackTrace(Thread.currentThread())));
|
|
|
}
|
|
|
|
|
|
@VisibleForTesting
|
|
|
void logWaitWarning(long lockWaitTime, SuppressedSnapshot stats) {
|
|
|
- logger.warn(String.format("Waited above threshold to acquire lock: " +
|
|
|
+ logger.warn(String.format("Waited above threshold(%d ms) to acquire lock: " +
|
|
|
"lock identifier: %s " +
|
|
|
"waitTimeMs=%d ms. Suppressed %d lock wait warnings. " +
|
|
|
"Longest suppressed WaitTimeMs=%d. " +
|
|
|
- "The stack trace is: %s", name, lockWaitTime,
|
|
|
+ "The stack trace is: %s", lockWarningThreshold, name, lockWaitTime,
|
|
|
stats.getSuppressedCount(), stats.getMaxSuppressedWait(),
|
|
|
StringUtils.getStackTrace(Thread.currentThread())));
|
|
|
}
|