]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Graph is generated as delay probability distribution function.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 5 Dec 2007 16:44:16 +0000 (17:44 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 5 Dec 2007 16:44:16 +0000 (17:44 +0100)
wme_test/run
wme_test/wclient.c

index 71d1b6e3d9ff0ceda9c64ce7c76d1208392f5019..fc2b7d9bb2e6bfc51dadead6435f4fddce4ed74c 100755 (executable)
@@ -23,15 +23,19 @@ fi
 
 cat <<EOF | gnuplot -persist
 set xlabel "Delay [ms]"
-set ylabel "Packet percentage"
+set ylabel "Probability distribution function [%]"
 set key right top nobox
 set style data linespoints
 ${LOGSCALE}set logscale y
 set grid
-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"
+plot [0:*] [0.01:*] "${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
index 3c5d5e8a1aa985f269681fece36f53868a188db9..26e43185e3e76164ecdb4b658132e10ace21df04 100644 (file)
@@ -124,6 +124,7 @@ void save_results()
                        fprintf(stderr, "No response in AC %d\n", ac);
        }
 
+       /* Write pdf */
        for ( i = 0 ; i < maxi; i++) {
                fprintf(logfd,"\n%f", i*opt_granularity_usec/1000.0);
                for (ac = 0; ac < AC_NUM; ac++) { 
@@ -134,6 +135,22 @@ void save_results()
                }
        }
        
+       fprintf(logfd,"\n\n");
+
+       /* Write PDF */
+       unsigned long long integral[AC_NUM];
+       for (ac = 0; ac < AC_NUM; ac++) integral[ac] = 0;
+       for ( i = 0 ; i < maxi; i++) {
+               fprintf(logfd,"\n%f", (i+1)*opt_granularity_usec/1000.0);
+               for (ac = 0; ac < AC_NUM; ac++) {
+                       integral[ac] += delay_stats[ac][i];
+                       if (sum[ac])
+                               val = (double)integral[ac]*100.0 / sum[ac];
+                       else val = 0;
+                       fprintf(logfd," %lf", val);
+               }
+       }
+       
        fprintf(stderr, "Finished.\n");
        fclose(logfd);