Clean up lock-instrumentation and improve comments (#3499)

- Add a lockStat type to group counters
- Remove unnecessary helper functions
- Fix stats computation on force unlock
- Removed unnecessary checks and cleaned up comments
This commit is contained in:
Krishnan Parthasarathi
2016-12-26 23:59:55 +05:30
committed by Harshavardhana
parent e8ce3b64ed
commit 36fd317eb2
5 changed files with 176 additions and 180 deletions

View File

@@ -66,17 +66,17 @@ func getSystemLockState() (SystemLockState, error) {
lockState := SystemLockState{}
lockState.TotalBlockedLocks = globalNSMutex.blockedCounter
lockState.TotalLocks = globalNSMutex.globalLockCounter
lockState.TotalAcquiredLocks = globalNSMutex.runningLockCounter
lockState.TotalBlockedLocks = globalNSMutex.counters.blocked
lockState.TotalLocks = globalNSMutex.counters.total
lockState.TotalAcquiredLocks = globalNSMutex.counters.granted
for param, debugLock := range globalNSMutex.debugLockMap {
volLockInfo := VolumeLockInfo{}
volLockInfo.Bucket = param.volume
volLockInfo.Object = param.path
volLockInfo.LocksOnObject = debugLock.ref
volLockInfo.TotalBlockedLocks = debugLock.blocked
volLockInfo.LocksAcquiredOnObject = debugLock.running
volLockInfo.LocksOnObject = debugLock.counters.total
volLockInfo.TotalBlockedLocks = debugLock.counters.blocked
volLockInfo.LocksAcquiredOnObject = debugLock.counters.granted
for opsID, lockInfo := range debugLock.lockInfo {
volLockInfo.LockDetailsOnObject = append(volLockInfo.LockDetailsOnObject, OpsLockState{
OperationID: opsID,