mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
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:
committed by
Harshavardhana
parent
e8ce3b64ed
commit
36fd317eb2
@@ -61,6 +61,7 @@ func initNSLock(isDistXL bool) {
|
||||
globalNSMutex = &nsLockMap{
|
||||
isDistXL: isDistXL,
|
||||
lockMap: make(map[nsParam]*nsLock),
|
||||
counters: &lockStat{},
|
||||
}
|
||||
|
||||
// Initialize nsLockMap with entry for instrumentation information.
|
||||
@@ -91,10 +92,8 @@ type nsLock struct {
|
||||
// Unlock, RLock and RUnlock.
|
||||
type nsLockMap struct {
|
||||
// Lock counter used for lock debugging.
|
||||
globalLockCounter int64 // Total locks held.
|
||||
blockedCounter int64 // Total operations blocked waiting for locks.
|
||||
runningLockCounter int64 // Total locks held but not released yet.
|
||||
debugLockMap map[nsParam]*debugLockInfoPerVolumePath // Info for instrumentation on locks.
|
||||
counters *lockStat
|
||||
debugLockMap map[nsParam]*debugLockInfoPerVolumePath // Info for instrumentation on locks.
|
||||
|
||||
// Indicates whether the locking service is part
|
||||
// of a distributed setup or not.
|
||||
|
||||
Reference in New Issue
Block a user