*/
void dumpLockTableInternal(StatGroup tableStats, int i, boolean clear) {
StatGroup oneTable = new StatGroup("Single lock table",
"Temporary stat group");
IntStat totalLocks = new IntStat(oneTable, LOCK_TOTAL);
IntStat waiters = new IntStat(oneTable, LOCK_WAITERS);
IntStat owners = new IntStat(oneTable, LOCK_OWNERS);
IntStat readLocks = new IntStat(oneTable, LOCK_READ_LOCKS);
IntStat writeLocks = new IntStat(oneTable, LOCK_WRITE_LOCKS);
Map<Long, Lock> lockTable = lockTables[i];
totalLocks.add(lockTable.size());
for (Lock lock : lockTable.values()) {
waiters.add(lock.nWaiters());
owners.add(lock.nOwners());
/* Go through all the owners for a lock. */
for (LockInfo info : lock.getOwnersClone()) {
if (info.getLockType().isWriteLock()) {
writeLocks.increment();
} else {
readLocks.increment();
}
}
}