From d56449b2b2f0d122555e745ba6e55202874240d4 Mon Sep 17 00:00:00 2001 From: Marc Mance Date: Thu, 30 May 2024 17:03:11 -0400 Subject: [PATCH] maybe done? --- topstat.py | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/topstat.py b/topstat.py index ee3a2bc..5f9b286 100644 --- a/topstat.py +++ b/topstat.py @@ -25,14 +25,14 @@ headerRow = [ "mem_inactive", "mem_wired", "mem_free", - "arc_total", - "arc_MFU", - "arc_MRU", - "arc_anon", - "arc_header", - "arc_other", - "swap_total", - "swap_free", + # "arc_total", + # "arc_MFU", + # "arc_MRU", + # "arc_anon", + # "arc_header", + # "arc_other", + # "swap_total", + # "swap_free", ] filename = "topStat.csv" @@ -126,7 +126,33 @@ def runtopstat(): for x in mem: meminmeg.append(convert_to_megabytes(x)) - breakpoint() + mem = meminmeg + + mem_active = mem[0] + mem_inactive = mem[1] + mem_wired = mem[2] + mem_free = mem[3] + + lineData = [ + timestamp, + "top", + loadaverage1, + loadaverage5, + loadaverage15, + total_processes, + running, + sleeping, + zombie, + cpu_user, + cpu_nice, + cpu_system, + cpu_interrupt, + cpu_idle, + mem_active, + mem_inactive, + mem_wired, + mem_free, + ] if lineData: with open(filename, "a", newline="") as csvfile: