nix: adjacent process monitoring report columns

This commit is contained in:
steve-chavez
2025-06-19 16:36:25 -05:00
parent e1c71c92d6
commit 49de3c1ab8
3 changed files with 20 additions and 3 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import psutil
import pandas as pd
KEY = "Elapsed seconds"
BASE_METRICS = ["CPU (%)", "MEM (%)", "Real (MB)"]
SAMPLE_INTERVAL_SECS = 1
if len(sys.argv) != 2 or not sys.argv[1].isdigit():
@@ -53,6 +54,6 @@ end = time.time()
total_time = end - start
print(f"Finished {pid} pid monitoring in {total_time:.3f}", file=sys.stderr)
cols = [KEY, "CPU (%)", "MEM (%)", "Real (MB)"]
cols = [KEY] + BASE_METRICS
df = pd.DataFrame(records, columns=cols, dtype=str)
df.to_csv(sys.stdout, index=False)