6 historylen
='10 30 60 90 120'
11 #statsdone=$(tail -n $historymax "$1".stats | head -n 1 | cut -d ' ' -f 1);
13 tail -f "$1" --pid=$$ |
while read line
; do
14 date="$(echo "$line" | cut -d ' ' -f 2)"
15 #test -n "$statsdone" && test "$date" -le "$statsdone" && continue;
16 state
="$(echo "$line" | cut -d ' ' -f 5)"
17 test -z "$lastdate" && lastdate
="$(( $date - 1 ))"
20 #echo $lastdate $date $state
22 for i
in $
(seq $lastdate $
(( $date - 1 ))); do
23 echo -ne "$i $state\t"
24 history=$
(echo -n "$laststate$history" |
head -c $historymax)
25 for len
in $historylen; do
26 on
="$(echo -n ${history::$len} | tr -d 0 | wc -c)"
27 on
="$(echo "scale
=2; $on/$len" | bc)"
34 #after=$(( $date - $lastdate))
35 #test $historymax -gt 0 && {
39 #Prepare invariants for next round
This page took 0.253903 seconds and 4 git commands to generate.