https://github.com/piorosen/mpstat2csv
Easy to install mpstat2csv conversion tool for chart and graph.
https://github.com/piorosen/mpstat2csv
cpu-monitoring csv monitoring mpstat
Last synced: 2 months ago
JSON representation
Easy to install mpstat2csv conversion tool for chart and graph.
- Host: GitHub
- URL: https://github.com/piorosen/mpstat2csv
- Owner: Piorosen
- License: mit
- Created: 2023-11-27T12:46:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T14:02:13.000Z (over 1 year ago)
- Last Synced: 2024-10-21T21:24:16.523Z (over 1 year ago)
- Topics: cpu-monitoring, csv, monitoring, mpstat
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mpstat2csv
It was created to measure CPU core usage through `mpstat`.
In particular, you can measure previous records through `sar`, but it's more troublesome than anything, right? It is convenient if you can warm up the program and immediately display the measured records as `CSV`. Give it a try! It's convenient.
## Requirements
1. `Python3` (Maybe... wouldn't it work even with Python 3.1? I just used the basic code.)
2. `mpstat` (if you don't have it, build at install time in install.sh)
3. `curl` Download for mpstat2csv.
## Getting started?
To install, run:
```sh
curl -fsSL https://raw.githubusercontent.com/Piorosen/mpstat2csv/main/install.sh | sh
```
To uninstall, run:
```sh
curl -fsSL https://raw.githubusercontent.com/Piorosen/mpstat2csv/main/uninstall.sh | sh
```
## How to run?
Enter the shellcode below to run mpstat for 1 hour.
```sh
# interval(unit) : Next step in mpstat event(captured cpu core) (second)
# Epoch(unit) : interval * Epoch == Total Captured time
mpstat2csv --interval=1 --epoch=3600 --file=export.csv
```
## Result
```sh
# I ran the code and got the result below.
mpstat2csv # it just have default value. --interval=1 --epoch=5
```
|time|all|0|1|2|3|4|
|---|---|---|---|---|---|---|
|3:23:01 PM|3.67|4.12|0|6.06|1|12.12 |
|3:23:02 PM|10.84|15.46 |6|19.39|5 |25|
|3:23:03 PM|3.49 |6 |0|4.04 |0 |6.25|
|3:23:04 PM|3.42 |6 |0|2.02 |0.99|9.09|
|3:23:05 PM|4.11 |4.08|1|4.04 |0 |10|