mirror of
https://github.com/minio/minio.git
synced 2025-04-07 21:25:36 -04:00
Remove duration field from lock instrumentation (#4111)
Duration for which a lock was held can be computed from the `Since` field of `OpsLockState`. It is the difference between current time and time at which the namespace lock was held. This change avoids superfluous instrumentation.
This commit is contained in:
parent
7765081db7
commit
3032f0f505
@ -141,7 +141,6 @@ func getSystemLockState() (SystemLockState, error) {
|
|||||||
LockType: lockInfo.lType,
|
LockType: lockInfo.lType,
|
||||||
Status: lockInfo.status,
|
Status: lockInfo.status,
|
||||||
Since: lockInfo.since,
|
Since: lockInfo.since,
|
||||||
Duration: UTCNow().Sub(lockInfo.since),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
lockState.LocksInfoPerObject = append(lockState.LocksInfoPerObject, volLockInfo)
|
lockState.LocksInfoPerObject = append(lockState.LocksInfoPerObject, volLockInfo)
|
||||||
|
@ -62,7 +62,6 @@ type OpsLockState struct {
|
|||||||
LockType lockType `json:"type"` // Lock type (RLock, WLock)
|
LockType lockType `json:"type"` // Lock type (RLock, WLock)
|
||||||
Status statusType `json:"status"` // Status can be Running/Ready/Blocked.
|
Status statusType `json:"status"` // Status can be Running/Ready/Blocked.
|
||||||
Since time.Time `json:"since"` // Time when the lock was initially held.
|
Since time.Time `json:"since"` // Time when the lock was initially held.
|
||||||
Duration time.Duration `json:"duration"` // Duration since the lock was held.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// listLocksInfo - Fetches locks held on bucket, matching prefix held for longer than duration.
|
// listLocksInfo - Fetches locks held on bucket, matching prefix held for longer than duration.
|
||||||
@ -105,7 +104,6 @@ func listLocksInfo(bucket, prefix string, duration time.Duration) []VolumeLockIn
|
|||||||
LockType: lockInfo.lType,
|
LockType: lockInfo.lType,
|
||||||
Status: lockInfo.status,
|
Status: lockInfo.status,
|
||||||
Since: lockInfo.since,
|
Since: lockInfo.since,
|
||||||
Duration: elapsed,
|
|
||||||
})
|
})
|
||||||
volumeLocks = append(volumeLocks, volLockInfo)
|
volumeLocks = append(volumeLocks, volLockInfo)
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ type OpsLockState struct {
|
|||||||
LockType lockType `json:"type"` // Lock type (RLock, WLock)
|
LockType lockType `json:"type"` // Lock type (RLock, WLock)
|
||||||
Status statusType `json:"status"` // Status can be Running/Ready/Blocked.
|
Status statusType `json:"status"` // Status can be Running/Ready/Blocked.
|
||||||
Since time.Time `json:"since"` // Time when the lock was initially held.
|
Since time.Time `json:"since"` // Time when the lock was initially held.
|
||||||
Duration time.Duration `json:"duration"` // Duration since the lock was held.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// VolumeLockInfo - represents summary and individual lock details of all
|
// VolumeLockInfo - represents summary and individual lock details of all
|
||||||
|
Loading…
x
Reference in New Issue
Block a user