platform: Fix bytes format

This commit is contained in:
世界 2023-03-16 11:15:55 +08:00
parent 14a0f180c8
commit a3a5185b15
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 4 additions and 4 deletions

View file

@ -25,9 +25,9 @@ func init() {
runtime.ReadMemStats(&memStats) runtime.ReadMemStats(&memStats)
var memObject badjson.JSONObject var memObject badjson.JSONObject
memObject.Put("heap", humanize.Bytes(memStats.HeapInuse)) memObject.Put("heap", humanize.IBytes(memStats.HeapInuse))
memObject.Put("stack", humanize.Bytes(memStats.StackInuse)) memObject.Put("stack", humanize.IBytes(memStats.StackInuse))
memObject.Put("idle", humanize.Bytes(memStats.HeapIdle-memStats.HeapReleased)) memObject.Put("idle", humanize.IBytes(memStats.HeapIdle-memStats.HeapReleased))
memObject.Put("goroutines", runtime.NumGoroutine()) memObject.Put("goroutines", runtime.NumGoroutine())
memObject.Put("rss", rusageMaxRSS()) memObject.Put("rss", rusageMaxRSS())

View file

@ -17,5 +17,5 @@ func Version() string {
} }
func FormatBytes(length int64) string { func FormatBytes(length int64) string {
return humanize.Bytes(uint64(length)) return humanize.IBytes(uint64(length))
} }