HexaCone/plot-timing.sh
2024-12-22 15:05:36 +01:00

48 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -ue
TMPFILE="/dev/shm/plot-timing.tmp"
IMAGE="timing.png"
tail -3600 WS/mp4.timing | awk ' \
BEGIN { \
nbrames=360;
for (foo=0; foo<nbrames; foo++) { \
mini[foo] = 666; \
maxi[foo] = -42; \
} \
} \
{ \
accu[$1] += $2; \
count[$1]++; \
if (mini[$1] > $2) mini[$1] = $2; \
if (maxi[$1] < $2) maxi[$1] = $2; \
last[$1] = $2; \
} \
END { \
for (foo=0; foo<nbrames; foo++) { \
if (count[foo] > 0) { \
mean = accu[foo] / count[foo]; \
printf "%4d %4f %4d %4d %4d\n", foo, mean, \
mini[foo], maxi[foo], last[foo]; \
} \
}
} \
' > $TMPFILE
gnuplot << __EOC__
set term png size 800,480
set output "timing.png"
set grid
set xrange [:360]
set yrange [:300]
set title "HexaCone : temps de tracé vs. numéro de séquence"
set xlabel "numéro de la trame"
set ylabel "temps en secondes"
plot "/dev/shm/plot-timing.tmp" u 1:2 w l t "moyenne", \
"/dev/shm/plot-timing.tmp" u 1:3 w l t "minimum", \
"/dev/shm/plot-timing.tmp" u 1:4 w l t "maximum", \
"/dev/shm/plot-timing.tmp" u 1:5 w l t "dernier"
__EOC__