HexaCone/plot-timing.sh

46 lines
1.0 KiB
Bash
Raw Normal View History

2024-12-20 05:26:03 +11:00
#!/bin/bash
set -ue
TMPFILE="/dev/shm/plot-timing.tmp"
IMAGE="timing.png"
2024-12-30 05:01:30 +11:00
tail -3600 WS/mp4.timing | awk ' \
2024-12-20 05:26:03 +11:00
BEGIN { \
2024-12-23 01:05:36 +11:00
nbrames=360;
for (foo=0; foo<nbrames; foo++) { \
2024-12-20 05:26:03 +11:00
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; \
} \
END { \
2024-12-23 01:05:36 +11:00
for (foo=0; foo<nbrames; foo++) { \
if (count[foo] > 0) { \
mean = accu[foo] / count[foo]; \
2024-12-29 14:56:10 +11:00
printf "%4d %4f %4d %4d\n", foo, mean, \
mini[foo], maxi[foo]; \
2024-12-23 01:05:36 +11:00
} \
}
2024-12-20 05:26:03 +11:00
} \
' > $TMPFILE
gnuplot << __EOC__
set term png size 800,480
set output "timing.png"
set grid
2024-12-23 01:05:36 +11:00
set xrange [:360]
2024-12-29 00:45:01 +11:00
set yrange [:240]
2024-12-20 05:26:03 +11:00
set title "HexaCone : temps de tracé vs. numéro de séquence"
set xlabel "numéro de la trame"
set ylabel "temps en secondes"
2024-12-29 14:56:10 +11:00
plot "/dev/shm/plot-timing.tmp" u 1:4 w l t "maximum", \
2024-12-20 05:26:03 +11:00
"/dev/shm/plot-timing.tmp" u 1:3 w l t "minimum", \
2024-12-29 14:56:10 +11:00
"/dev/shm/plot-timing.tmp" u 1:2 w l t "moyenne",
2024-12-20 05:26:03 +11:00
__EOC__