Fix disk cache usage percent for prometheus (#10898)

Fixes: #10895

Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io>
master
Poorna Krishnamoorthy 4 years ago committed by GitHub
parent b5a3d79bce
commit d295ce5708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/disk-cache-backend.go

@ -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…
Cancel
Save