mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: fixed RAM top processes parsing (#697)
This commit is contained in:
@@ -158,9 +158,9 @@ public class ProcessReader: Reader<[TopProcess]> {
|
||||
|
||||
let pid = Int(pidString.filter("01234567890.".contains)) ?? 0
|
||||
var usage = Double(usageString.filter("01234567890.".contains)) ?? 0
|
||||
if usageString.contains("G") && usageString.first != "G" {
|
||||
if usageString.last == "G" {
|
||||
usage *= 1024 // apply gigabyte multiplier
|
||||
} else if usageString.contains("K") && usageString.first != "K" {
|
||||
} else if usageString.last == "K" {
|
||||
usage /= 1024 // apply kilobyte divider
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user