diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2023-02-10 12:40:11 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2023-02-10 12:40:11 -0500 |
commit | e07d09df965c65fb59029a3af01b4d0727b4ae21 (patch) | |
tree | 2b3a73eaa8ab9921e1286f030b0ea0dc91e03fe0 | |
parent | ceb25630b84068cba8d4a5c6ed716395ddd8fbeb (diff) | |
download | mstat-e07d09df965c65fb59029a3af01b4d0727b4ae21.tar.gz |
Add slightly more information to the README
-rw-r--r-- | README.md | 44 |
1 files changed, 40 insertions, 4 deletions
@@ -4,21 +4,57 @@ Record the memory usage of a process over time. # How to use MSTAT +```text +usage: mstat [OPTIONS] [-p PID] | {PROGRAM... ARGS} +-c clobber 'PID#.mstat' if it exists +-h this help message +-o DIR path to output directory (must exist) +-p PID process id to monitor +-s RATE samples per second (default: 1.00) +-v increased verbosity +``` + +## Monitor an existing process + +```shell +$ mstat -p 12345 +PID: 12345 +Samples per second: 1.00 +(interrupt with ctrl-c...) +``` + +## Monitor a new process + ```shell -mstat <pid_here> +$ mstat -s 10000 free +PID: 12345 +Samples per second: 10000.00 +(interrupt with ctrl-c...) + total used free shared buff/cache available +Mem: 28455904 8951836 10728332 476032 8775736 18596172 +Swap: 16777212 0 16777212 +pid 148257 returned 0 +data written: 12345.mstat ``` ## Plotting -Requires `gnuplot` to be installed +Requires `gnuplot` to be installed. +- Debian / Ubuntu + - `apt update && apt install gnuplot` +- Fedora / RHEL + - `yum install gnuplot` +- Arch Linux + - `pacman -S gnuplot` + ```shell -mstat_plot <pid_here>.mstat +$ mstat_plot 12345.mstat ``` ## CSV export ```shell -mstat_export <pid_here>.mstat > data.csv +$ mstat_export 12345.mstat > 12345.csv ``` |