diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-04-16 10:26:26 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-04-16 10:26:26 +0000 |
commit | bce641c09638e4e9335d67e5989287a686e9ed71 (patch) | |
tree | 185dd8e478353e2981a7e18441d8b533c98906a9 /src/ats/gnunet-ats-solver-eval.c | |
parent | 1d86abee3e9816d7eb294495c00d6239dc86e830 (diff) | |
download | gnunet-bce641c09638e4e9335d67e5989287a686e9ed71.tar.gz gnunet-bce641c09638e4e9335d67e5989287a686e9ed71.zip |
prop logging
Diffstat (limited to 'src/ats/gnunet-ats-solver-eval.c')
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c index 32b392bf0..978d146a8 100644 --- a/src/ats/gnunet-ats-solver-eval.c +++ b/src/ats/gnunet-ats-solver-eval.c | |||
@@ -288,6 +288,8 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l) | |||
288 | struct LoggingFileHandle *next; | 288 | struct LoggingFileHandle *next; |
289 | char * filename; | 289 | char * filename; |
290 | char * datastring; | 290 | char * datastring; |
291 | char * propstring; | ||
292 | char * propstring_tmp; | ||
291 | int c; | 293 | int c; |
292 | 294 | ||
293 | 295 | ||
@@ -335,15 +337,43 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l) | |||
335 | } | 337 | } |
336 | GNUNET_free (filename); | 338 | GNUNET_free (filename); |
337 | GNUNET_CONTAINER_DLL_insert (lf_head, lf_tail, cur); | 339 | GNUNET_CONTAINER_DLL_insert (lf_head, lf_tail, cur); |
340 | |||
341 | GNUNET_asprintf(&datastring,"#timestamp_abs; addr_active; bw in; bw out; " \ | ||
342 | "UTILIZATION_UP [abs/rel]; UTILIZATION_UP; UTILIZATION_DOWN; UTILIZATION_DOWN; " \ | ||
343 | "UTILIZATION_PAYLOAD_UP; UTILIZATION_PAYLOAD_UP; UTILIZATION_PAYLOAD_DOWN; UTILIZATION_PAYLOAD_DOWN; "\ | ||
344 | "NETWORK_TYPE; NETWORK_TYPE; DELAY; DELAY; " \ | ||
345 | "DISTANCE ;DISTANCE ; COST_WAN; COST_WAN; COST_LAN; COST_LAN; " \ | ||
346 | "COST_WLAN; COST_WLAN\n", | ||
347 | lts->timestamp.abs_value_us, | ||
348 | log_a->active, | ||
349 | ntohl (log_a->assigned_bw_in.value__), | ||
350 | ntohl (log_a->assigned_bw_out.value__)); | ||
351 | GNUNET_DISK_file_write (cur->f_hd, datastring, strlen(datastring)); | ||
352 | GNUNET_free (datastring); | ||
353 | |||
338 | } | 354 | } |
339 | 355 | ||
340 | GNUNET_asprintf(&datastring,"%i;%u;%u\n", | 356 | propstring = GNUNET_strdup(""); |
357 | for (c = 1; c < GNUNET_ATS_PropertyCount; c++) | ||
358 | { | ||
359 | fprintf(stderr, "\t %s = %.2f %.2f [abs/rel]\n", | ||
360 | GNUNET_ATS_print_property_type(c), | ||
361 | log_a->prop_abs[c], log_a->prop_norm[c]); | ||
362 | GNUNET_asprintf(&propstring_tmp,"%s;%.3f;%.3f", | ||
363 | propstring, log_a->prop_abs[c], log_a->prop_norm[c]); | ||
364 | GNUNET_free (propstring); | ||
365 | propstring = GNUNET_strdup(propstring_tmp); | ||
366 | GNUNET_free (propstring_tmp); | ||
367 | } | ||
368 | |||
369 | GNUNET_asprintf(&datastring,"%llu;%i;%u;%u;%s\n", | ||
370 | lts->timestamp.abs_value_us, | ||
341 | log_a->active, | 371 | log_a->active, |
342 | ntohl (log_a->assigned_bw_in.value__), | 372 | ntohl (log_a->assigned_bw_in.value__), |
343 | ntohl (log_a->assigned_bw_out.value__)); | 373 | ntohl (log_a->assigned_bw_out.value__),propstring); |
344 | GNUNET_DISK_file_write (cur->f_hd, datastring, strlen(datastring)); | 374 | GNUNET_DISK_file_write (cur->f_hd, datastring, strlen(datastring)); |
345 | GNUNET_free (datastring); | 375 | GNUNET_free (datastring); |
346 | 376 | GNUNET_free (propstring); | |
347 | } | 377 | } |
348 | } | 378 | } |
349 | } | 379 | } |