aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-09-20 13:31:48 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-09-20 13:31:48 +0000
commit128d0a17bc0985be7e9d2c31449c2c0c3f8061da (patch)
treebf473abd54778d078af0c6d3f9572398fcdaab6d /src
parentd4347e0238b041e24ffc71fc8a76bb43fe5b2cef (diff)
downloadgnunet-128d0a17bc0985be7e9d2c31449c2c0c3f8061da.tar.gz
gnunet-128d0a17bc0985be7e9d2c31449c2c0c3f8061da.zip
improved column indexing
Diffstat (limited to 'src')
-rw-r--r--src/ats-tests/perf_ats_logging.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c
index 30d6e397e..ea51abae5 100644
--- a/src/ats-tests/perf_ats_logging.c
+++ b/src/ats-tests/perf_ats_logging.c
@@ -40,6 +40,16 @@
40"set ylabel \"ms\" \n" 40"set ylabel \"ms\" \n"
41 41
42#define LOG_ITEMS_PER_PEER 7 42#define LOG_ITEMS_PER_PEER 7
43#define LOG_ITEMS_TIME 2
44
45#define LOG_ITEMS_BYTES_SENT 1
46#define LOG_ITEMS_MSGS_SENT 2
47#define LOG_ITEMS_THROUGHPUT_SENT 3
48#define LOG_ITEMS_BYTES_RECV 4
49#define LOG_ITEMS_MSGS_RECV 5
50#define LOG_ITEMS_THROUGHPUT_RECV 6
51#define LOG_ITEMS_APP_RTT 7
52
43 53
44/** 54/**
45 * Logging task 55 * Logging task
@@ -182,7 +192,7 @@ write_throughput_gnuplot_script (char * fn, struct LoggingPeer *lp)
182 char * gfn; 192 char * gfn;
183 char *data; 193 char *data;
184 int c_s; 194 int c_s;
185 int index; 195 int peer_index;
186 196
187 GNUNET_asprintf (&gfn, "gnuplot_throughput_%s",fn); 197 GNUNET_asprintf (&gfn, "gnuplot_throughput_%s",fn);
188 f = GNUNET_DISK_file_open (gfn, 198 f = GNUNET_DISK_file_open (gfn,
@@ -201,26 +211,27 @@ write_throughput_gnuplot_script (char * fn, struct LoggingPeer *lp)
201 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); 211 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn);
202 212
203 /* Write master data */ 213 /* Write master data */
214 peer_index = LOG_ITEMS_TIME;
204 GNUNET_asprintf (&data, "plot '%s' using 2:%u with lines title 'Master %u send total', \\\n" \ 215 GNUNET_asprintf (&data, "plot '%s' using 2:%u with lines title 'Master %u send total', \\\n" \
205 "'%s' using 2:%u with lines title 'Master %u receive total', \\\n", 216 "'%s' using 2:%u with lines title 'Master %u receive total', \\\n",
206 fn, 5, lp->peer->no, 217 fn, peer_index + LOG_ITEMS_THROUGHPUT_SENT, lp->peer->no,
207 fn, 8, lp->peer->no); 218 fn, peer_index + LOG_ITEMS_THROUGHPUT_RECV, lp->peer->no);
208 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data))) 219 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data)))
209 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); 220 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn);
210 GNUNET_free (data); 221 GNUNET_free (data);
211 222
212 index = 2 + LOG_ITEMS_PER_PEER + 3 ; 223 peer_index = LOG_ITEMS_TIME + LOG_ITEMS_PER_PEER ;
213 for (c_s = 0; c_s < lp->peer->num_partners; c_s++) 224 for (c_s = 0; c_s < lp->peer->num_partners; c_s++)
214 { 225 {
215 GNUNET_asprintf (&data, "'%s' using 2:%u with lines title 'Master - Slave %u send', \\\n" \ 226 GNUNET_asprintf (&data, "'%s' using 2:%u with lines title 'Master %u - Slave %u send', \\\n" \
216 "'%s' using 2:%u with lines title 'Master - Slave %u receive'%s\n", 227 "'%s' using 2:%u with lines title 'Master %u - Slave %u receive'%s\n",
217 fn, index, lp->peer->partners[c_s].dest->no, 228 fn, peer_index + LOG_ITEMS_THROUGHPUT_SENT, lp->peer->no, lp->peer->partners[c_s].dest->no,
218 fn, index+3, lp->peer->partners[c_s].dest->no, 229 fn, peer_index + LOG_ITEMS_THROUGHPUT_RECV, lp->peer->no, lp->peer->partners[c_s].dest->no,
219 (c_s < lp->peer->num_partners -1) ? ", \\" : "\n pause -1"); 230 (c_s < lp->peer->num_partners -1) ? ", \\" : "\n pause -1");
220 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data))) 231 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data)))
221 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); 232 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn);
222 GNUNET_free (data); 233 GNUNET_free (data);
223 index += LOG_ITEMS_PER_PEER; 234 peer_index += LOG_ITEMS_PER_PEER;
224 } 235 }
225 236
226 if (GNUNET_SYSERR == GNUNET_DISK_file_close(f)) 237 if (GNUNET_SYSERR == GNUNET_DISK_file_close(f))
@@ -257,13 +268,12 @@ write_rtt_gnuplot_script (char * fn, struct LoggingPeer *lp)
257 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, RTT_TEMPLATE, strlen(RTT_TEMPLATE))) 268 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, RTT_TEMPLATE, strlen(RTT_TEMPLATE)))
258 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); 269 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn);
259 270
260 /* 1st column: 2 * timestamp _+ 7 * master + 7 */ 271 index = LOG_ITEMS_TIME + LOG_ITEMS_PER_PEER;
261 index = 2 + LOG_ITEMS_PER_PEER + LOG_ITEMS_PER_PEER;
262 for (c_s = 0; c_s < lp->peer->num_partners; c_s++) 272 for (c_s = 0; c_s < lp->peer->num_partners; c_s++)
263 { 273 {
264 GNUNET_asprintf (&data, "%s'%s' using 2:%u with lines title 'Master - Slave %u '%s\n", 274 GNUNET_asprintf (&data, "%s'%s' using 2:%u with lines title 'Master %u - Slave %u '%s\n",
265 (0 == c_s) ? "plot " :"", 275 (0 == c_s) ? "plot " :"",
266 fn, index, lp->peer->partners[c_s].dest->no, 276 fn, index + LOG_ITEMS_APP_RTT, lp->peer->no, lp->peer->partners[c_s].dest->no,
267 (c_s < lp->peer->num_partners -1) ? ", \\" : "\n pause -1"); 277 (c_s < lp->peer->num_partners -1) ? ", \\" : "\n pause -1");
268 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data))) 278 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data)))
269 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); 279 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn);