-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxsrrd2gnuplot
executable file
·39 lines (33 loc) · 1.11 KB
/
xsrrd2gnuplot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh -e
rrd_dir="$1"
vmtype="$2"
filters="$3"
dat_dir="$4"
: ${rrd_dir:?"$
usage: $0 <rrd_dir> <vm_type> \"<filters>\" [dat_dir]
where:
- rrd_dir is the location where the rrd files will be read from
- vmtype is one of the following values:
- dom0: returns only dom0 rrd data
- guests: returns only non-dom0 rrd data
- filters is one or more of the following values:
- cpu* : for all cpus
- cpuX : for specific cpu X
- memory*: for all memory-related data
- vbd* : for all vbd-related data
- vbd-hdX*: for a specific vbd X data
- vbd-hdX-read*: for specific vbd X read data
- vbd-hdX-write*: for specific vbd X write data
- vif* : for all vif-related data
- vif_X* : for specific vif X data
- vif_X_rx: for specific vif X rx data
- vif_X_tx: for specific vif X tx data
You can also use the {} expansion, eg: \"vif_*_{rx,tx}\"
- dat_dir is the location where the .dat files will be read from"
}
: ${vmtype:="guests"}
: ${filters:="cpu* vif* vbd* memory*"}
: ${dat_dir:=$(mktemp -d)}
xsrrd2dat "${rrd_dir}" "${dat_dir}"
echo "dat_dir=${dat_dir}"
xsdat2gnuplot "${vmtype}" "${filters}" "${dat_dir}" .