can anybody tell me about 11th field in /proc/diskstats? The documentation says that it is weighted # of milliseconds spent doing I/Os. Is it like # of milliseconds spent for DiskIO in a second?
I logged this value every 200ms after subtracting previous one from it and observed the value as high as 7000. I need to plot a graph showing disk IO rate. Here is the script:
#!/bin/bash
PREV_TOTAL=0
echo "" >> $1
while true; do
numbers=( $(tail -3 < /proc/diskstats | head -2 | awk '{print $14}' ) ) ;
let "TOTAL=$((${numbers[0]} + ${numbers[1]}))"
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
time=`date +%s%N`
echo "$time $DIFF_TOTAL" >> $1
PREV_TOTAL="$TOTAL"
# Wait before checking again.
sleep 0.2
done
Can anybody explain this field?