set key right bottom nobox
set style data linespoints
set grid
-plot [0:*] [0.01:99.9999] "${FILE}.dat" index 1 using 1:2 title "AC_VO",\
+plot [0:*] [0.0001:99.9999] "${FILE}.dat" index 1 using 1:2 title "AC_VO",\
"${FILE}.dat" index 1 using 1:3 title "AC_VI",\
"${FILE}.dat" index 1 using 1:4 title "AC_BE",\
"${FILE}.dat" index 1 using 1:5 title "AC_BK"
FILE=delay_stats
ARGV="$@"
-LOGSCALE="#"
while [ $# -gt 0 ]
do
case $1 in
-o) FILE="$2";;
- -l) LOGSCALE="";; # doesn't work
- --) ONLY_PLOT=1;;
esac
shift
done
-if [ -z "$ONLY_PLOT" ]
-then
- ./wclient $ARGV
-fi
+./wclient $ARGV
-COMMAND="Results of: $(grep 'Invoked as' ${FILE}.dat|grep -o 'wclient.*')"
-STREAMS="$(grep -o 'Stream.*' ${FILE}.dat|sort|while read LINE; do echo $LINE\\n; done|tr -d '\n')"
-
-TITLE="${COMMAND}\n\n${STREAMS}"
-
-cat <<EOF | gnuplot -persist
-set xlabel "Delay [ms]"
-set ylabel "Probability distribution function [%]"
-set title "${TITLE}"
-set key right bottom nobox
-set style data linespoints
-set grid
-plot [0:*] [0.01:99.9999] "${FILE}.dat" index 1 using 1:2 title "AC_VO",\
- "${FILE}.dat" index 1 using 1:3 title "AC_VI",\
- "${FILE}.dat" index 1 using 1:4 title "AC_BE",\
- "${FILE}.dat" index 1 using 1:5 title "AC_BK"
-# plot [0:*] [0.01:*] "${FILE}.dat" using 1:2 title "AC_VO",\
-# "${FILE}.dat" using 1:3 title "AC_VI",\
-# "${FILE}.dat" using 1:4 title "AC_BE",\
-# "${FILE}.dat" using 1:5 title "AC_BK"
- set term postscript color eps size 12cm,9cm
-set output '${FILE}.eps'
-replot
-EOF
+./plot $FILE.dat
unsigned sum[AC_NUM];
double val;
- fprintf(stderr, "\nWriting data to %s...\n", logfname);
+ fprintf(stderr, "Writing data to %s... ", logfname);
+ fflush(stderr);
/* Find maximal delay */
allzeros = true;
sum[ac] = 0;
for ( i = 0 ; i < maxi; i++)
sum[ac]+=delay_stats[ac][i];
- if (sum[ac] == 0)
- fprintf(stderr, "No response in AC %d\n", ac);
+/* if (sum[ac] == 0) */
+/* fprintf(stderr, "No response in AC %d\n", ac); */
}
/* Write pdf */
for (ac = 0; ac < AC_NUM; ac++) {
if (sum[ac])
val = (double)delay_stats[ac][i]*100.0 / sum[ac];
- else val = 0;
+ else val = -1; /* Don't display this ac */
fprintf(logfd," %lf", val);
}
}
for (ac = 0; ac < AC_NUM; ac++) {
if (sum[ac])
val = (double)integral[ac]*100.0 / sum[ac];
- else val = 0;
+ else val = -1; /* Don't display this ac */
fprintf(logfd," %lf", val);
if (i>0)
integral[ac] += delay_stats[ac][i-1];
}
}
- fprintf(stderr, "Finished.\n");
+ fprintf(stderr, "finished.\n");
fclose(logfd);
exit(0);
for (i=0; i < nr_sepoints + AC_NUM; i++) {
sem_wait(&sem_thread_finished);
}
- printf("\n");
-
save_results();
return 0;