Last active
July 13, 2024 06:23
-
-
Save chapmanjacobd/d64dc2b57beabbd2e198bd571c37bea8 to your computer and use it in GitHub Desktop.
plot /proc/pressure/memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/rfjakob/earlyoom/blob/c759f1bef2b50d0e0b249bff650e730655c98c0e/contrib/oomstat/overload.txt | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
from xklb.utils import processes | |
df = pd.read_csv(StringIO(processes.cmd('cb').stdout.replace('|',' ')), delim_whitespace=True) | |
df.set_index('Time', inplace=True) | |
df = df.apply(pd.to_numeric) | |
ax = df.plot(subplots=True, figsize=(10, 6), marker='o') | |
for i, ax in enumerate(ax): | |
ax.set_title(df.columns[i]) | |
ax.set_xlabel('Time (s)') | |
ax.set_ylabel(df.columns[i]) | |
plt.tight_layout() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/rfjakob/earlyoom/blob/c759f1bef2b50d0e0b249bff650e730655c98c0e/contrib/oomstat/ontheedge.txt