GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
43f096b
)
Code cleanup
author
Tomas Mudrunka
<tomas@mudrunka.cz>
Fri, 3 Aug 2012 07:38:11 +0000
(09:38 +0200)
committer
Tomas Mudrunka
<tomas@mudrunka.cz>
Fri, 3 Aug 2012 07:38:11 +0000
(09:38 +0200)
c/goertzel/sleepmon.sh
patch
|
blob
|
blame
|
history
diff --git
a/c/goertzel/sleepmon.sh
b/c/goertzel/sleepmon.sh
index 729d9bb878d7fab880d9aa78f924c6f74f2a0b25..cfa02973e5144863ac161dc9f38d5f857c6225c6 100755
(executable)
--- a/
c/goertzel/sleepmon.sh
+++ b/
c/goertzel/sleepmon.sh
@@
-23,10
+23,6
@@
bash ./sleepstats.sh "$out" &>/dev/null &
tresh=10
lastdate="$(date +%s)"
tresh=10
lastdate="$(date +%s)"
-laststate=0
-history='';
-historymax=120;
-historylen='10 30 60 90 120'
screen=false
graph=false
screen=false
graph=false
@@
-52,18
+48,8
@@
arecord | ./goertzel -n i -q -l c -t $tresh -d 4 | while read line; do
printf "%.2f\t %s %s %d" "$time" "$date" "$(date '+%F %T')" "$statenum"
printf "%.2f\t %s %s %d" "$time" "$date" "$(date '+%F %T')" "$statenum"
- #History
- after=$(( $date - $lastdate))
- test $historymax -gt 0 && {
- history=$(echo -n "$(yes | tr '\ny' $laststate | head -c $after)$history" | head -c $historymax)
- for len in $historylen; do
- on="$(echo -n ${history::$len} | tr -d 0 | wc -c)"
- on="$(echo "scale=2; $on/$len" | bc)"
- printf " %.2f" "$on"
- done
- }
-
#Debug
#Debug
+ after=$(( $date - $lastdate))
printf " (%s %3d After %4d secs)\n" "$statename" "$level" "$after";
#Fun with values
printf " (%s %3d After %4d secs)\n" "$statename" "$level" "$after";
#Fun with values
@@
-76,7
+62,6
@@
arecord | ./goertzel -n i -q -l c -t $tresh -d 4 | while read line; do
#Prepare invariants for next round
lastdate="$date";
#Prepare invariants for next round
lastdate="$date";
- laststate="$statenum";
done | tee "$out"
kill $(jobs -p); sleep 0.2
echo
done | tee "$out"
kill $(jobs -p); sleep 0.2
echo
This page took
0.094154 seconds
and
4
git commands to generate.