docs: update README

This commit is contained in:
Daniel Langbein 2023-08-13 16:40:26 +02:00
parent a25e1cb67d
commit 118709eb87

View File

@ -189,25 +189,34 @@ pip install graph-cli
3) Create plots 3) Create plots
Create one plot for each .csv file: Create one plot for each .csv file with different resampling methods (https://pandas.pydata.org/pandas-docs/stable/reference/resampling.html#computations-descriptive-stats):
```shell ```shell
sample_duration=4H function plot(){
for file in "${@}"; do
graph "${file}" -x 1 --resample "${sample_duration}" --resample-action "${action}" --figsize 1600x1000 -o "${file}".resample-"${sample_duration}-${action}".png || {
echo "Error while processing ${file}"
}
done
}
for file in *.csv; do # MEAN
graph "${file}" -x 1 --resample "${sample_duration}" --figsize 1600x1000 -o "${file}".resample-"${sample_duration}"-mean.png || { sample_duration=24H
echo "Error while processing ${file}" action=mean
} plot {swap,memory}.csv {temp_,cpu_,sensor_script_}*.csv
done
for file in {swap,memory}.csv {temp_,drive_,net_,cpu_,filesystem_}*.csv; do # MAX
graph "${file}" -x 1 --resample "${sample_duration}" --resample-action max --figsize 1600x1000 -o "${file}".resample-"${sample_duration}"-max.png || { sample_duration=24H
echo "Error while processing ${file}" action=max
} plot {swap,memory}.csv {temp_,drive_,net_,cpu_,filesystem_,sensor_script_}*.csv
done
# SUM
sample_duration=24H
action=sum
plot net_*.csv
``` ```
4) Optionally, create more plots 4) Create more plots as you like
Some self-explaining examples: Some self-explaining examples:
@ -222,17 +231,6 @@ graph cpu_1min.csv -x 1 --resample 1H -o cpu_1min_resample-1H.png
graph cpu_1min.csv -x 1 --resample 1H --figsize 1600x1000 -o cpu_1min_resample-1H.png graph cpu_1min.csv -x 1 --resample 1H --figsize 1600x1000 -o cpu_1min_resample-1H.png
``` ```
```shel
# resample using sum
graph net_enp0s31f6.csv.exported.csv -x 1 --resample 1H --resample-action sum --figsize 1600x1000 -o net_enp0s31f6.csv.exported_resample-1H-sum.png
```
```shel
# resample using max
graph cpu_1min.csv -x 1 --resample 1H --resample-action max --figsize 1600x1000 -o cpu_1min_resample-1H-max.png
```
### Example plots ### Example plots
![img](images/cpu_1min.csv.resample-1H.png) ![img](images/cpu_1min.csv.resample-1H.png)