mirror of
https://github.com/minio/minio
synced 2024-11-05 17:34:01 +00:00
Fix disk cache usage percent for prometheus (#10898)
Fixes: #10895 Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
parent
b5a3d79bce
commit
d295ce5708
1 changed files with 2 additions and 2 deletions
|
@ -205,9 +205,9 @@ func (c *diskCache) diskUsageLow() bool {
|
|||
logger.LogIf(ctx, err)
|
||||
return false
|
||||
}
|
||||
usedPercent := (di.Used / di.Total) * 100
|
||||
usedPercent := float64(di.Used) * 100 / float64(di.Total)
|
||||
low := int(usedPercent) < gcStopPct
|
||||
atomic.StoreUint64(&c.stats.UsagePercent, usedPercent)
|
||||
atomic.StoreUint64(&c.stats.UsagePercent, uint64(usedPercent))
|
||||
if low {
|
||||
atomic.StoreInt32(&c.stats.UsageState, 0)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue