]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - scripts/zpios-profile/zpios-profile-disk.sh
3 # /proc/diskinfo <after skipping major/minor>
4 # Field 1 -- device name
5 # Field 2 -- # of reads issued
6 # Field 3 -- # of reads merged
7 # Field 4 -- # of sectors read
8 # Field 5 -- # of milliseconds spent reading
9 # Field 6 -- # of writes completed
10 # Field 7 -- # of writes merged
11 # Field 8 -- # of sectors written
12 # Field 9 -- # of milliseconds spent writing
13 # Field 10 -- # of I/Os currently in progress
14 # Field 11 -- # of milliseconds spent doing I/Os
15 # Field 12 -- weighted # of milliseconds spent doing I/Os
17 PROG
=zpios-profile-disk.sh
30 for DISK_FILE
in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/disk-[0-9]*`; do
32 ROW_N
=( `cat ${DISK_FILE} | grep sd | cut -c11- | cut -f${FIELD} -d' ' | tr "\n" "\t"` )
34 if [ $HEADER -eq 1 ]; then
36 cat ${DISK_FILE} |
grep sd | cut
-c11- | cut
-f1 -d' ' |
tr "\n" ", "
41 if [ ${#ROW_M[@]} -eq 0 ]; then
45 if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
46 echo "Badly formatted profile data in ${DISK_FILE}"
52 for (( i
=0; i
<${#ROW_N[@]}; i
++ )); do
53 DELTA
=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
54 let TOTAL
=${TOTAL}+${DELTA}
71 for DISK_FILE
in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/disk-[0-9]*`; do
73 ROW_N
=( `cat ${DISK_FILE} | grep sd | cut -c11- | cut -f${FIELD} -d' ' | tr "\n" "\t"` )
75 if [ $HEADER -eq 1 ]; then
77 cat ${DISK_FILE} |
grep sd | cut
-c11- | cut
-f1 -d' ' |
tr "\n" ", "
82 if [ ${#ROW_M[@]} -eq 0 ]; then
86 if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
87 echo "Badly formatted profile data in ${DISK_FILE}"
93 for (( i
=0; i
<${#ROW_N[@]}; i
++ )); do
94 DELTA
=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
95 MBS
=`echo "scale=2; ((${DELTA}*512)/${TIME})/(1024*1024)" | bc`
96 TOTAL
=`echo "scale=2; ${TOTAL}+${MBS}" | bc`
106 echo "Reads issued per device"
109 echo "Reads merged per device"
112 echo "Sectors read per device"
114 echo "MB/s per device"
118 echo "Writes issued per device"
121 echo "Writes merged per device"
124 echo "Sectors written per device"
126 echo "MB/s per device"