]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Small fixes of wclient terminal output.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 6 Dec 2007 14:22:24 +0000 (15:22 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 6 Dec 2007 14:22:24 +0000 (15:22 +0100)
wme_test/plot
wme_test/run
wme_test/wclient.c

index f2cf444067d0d078b4de7ecfb4e081bedfe6c2ac..d4fedcc97a71b1b0ddd9f0ee1a37a8e212bedaa6 100755 (executable)
@@ -30,7 +30,7 @@ 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",\
+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"
index 53ef84d016bbd64b0481881c6fbe26179e7dc8ec..1f73f42415854a882fe505682b8abd1c17a51898 100755 (executable)
@@ -4,44 +4,15 @@ set -e
 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
index 50693b2eb6f533d3372c776f942e6b3ada9c6bd3..b4a45a859e335bc46b17e03e0ebc77817541dd6a 100644 (file)
@@ -105,7 +105,8 @@ void save_results()
        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;
@@ -123,8 +124,8 @@ void save_results()
                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 */
@@ -133,7 +134,7 @@ void save_results()
                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);
                }
        }
@@ -148,14 +149,14 @@ void save_results()
                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);
@@ -549,8 +550,6 @@ int main(int argc, char *argv[])
        for (i=0; i < nr_sepoints + AC_NUM; i++) {
                sem_wait(&sem_thread_finished);
        }
-       printf("\n");
-
        save_results();
 
        return 0;