fix: fixed top processes usage in the RAM when top returns additional + (#499)

This commit is contained in:
Serhiy Mytrovtsiy
2021-06-12 09:14:29 +02:00
parent eef7668bfe
commit c599484138

View File

@@ -148,7 +148,7 @@ public class ProcessReader: Reader<[TopProcess]> {
if line.matches("^\\d+ +.* +\\d+[A-Z]*\\+?\\-? *$") {
var str = line.trimmingCharacters(in: .whitespaces)
let pidString = str.findAndCrop(pattern: "^\\d+")
let usageString = str.suffix(5)
let usageString = str.suffix(6)
var command = str.replacingOccurrences(of: pidString, with: "")
command = command.replacingOccurrences(of: usageString, with: "")