changed top command to remove ansi

This commit is contained in:
Marc Mance
2024-07-31 13:07:50 -04:00
parent bda7d17559
commit ed243f0f92

View File

@@ -100,14 +100,8 @@ def convert_to_megabytes(data_size):
return int(size * unit_map[unit]) return int(size * unit_map[unit])
def remove_ansi_escape(text):
"""Removes ANSI escape sequences from a string."""
ansi_escape = re.compile(r"\x1B(?:[@-Z\\^[\]m])+")
return ansi_escape.sub("", text)
def scaleMemstat(): def scaleMemstat():
command = ["top", "-n", "1"] command = ["top", "-bn", "1"]
filename = "memStat.csv" filename = "memStat.csv"
collect = runCollect(command) collect = runCollect(command)