aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-02-03 22:54:18 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-02-03 22:54:18 +0000
commit43c8f5367b1e1a53d4bf7396fd7917be3c9e44a2 (patch)
tree1de1a1c13c49c8841bfba51c56c4775adc0f165b /src/ats-tests
parentfdaa7877af4902433a51c217ea379e1accb63090 (diff)
downloadgnunet-43c8f5367b1e1a53d4bf7396fd7917be3c9e44a2.tar.gz
gnunet-43c8f5367b1e1a53d4bf7396fd7917be3c9e44a2.zip
preference logging
Diffstat (limited to 'src/ats-tests')
-rw-r--r--src/ats-tests/ats-testing-log.c14
-rw-r--r--src/ats-tests/ats-testing-preferences.c11
-rw-r--r--src/ats-tests/ats-testing.h3
3 files changed, 25 insertions, 3 deletions
diff --git a/src/ats-tests/ats-testing-log.c b/src/ats-tests/ats-testing-log.c
index f41af3573..5c3d95820 100644
--- a/src/ats-tests/ats-testing-log.c
+++ b/src/ats-tests/ats-testing-log.c
@@ -140,6 +140,9 @@ struct PartnerLoggingTimestep
140 uint32_t ats_cost_lan; 140 uint32_t ats_cost_lan;
141 141
142 uint32_t ats_cost_wlan; 142 uint32_t ats_cost_wlan;
143
144 double pref_bandwidth;
145 double pref_delay;
143}; 146};
144 147
145 148
@@ -492,7 +495,8 @@ GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l,
492 /* Header */ 495 /* Header */
493 GNUNET_asprintf (&data, "# master %u; slave %u ; experiment : %s\n" 496 GNUNET_asprintf (&data, "# master %u; slave %u ; experiment : %s\n"
494 "timestamp; timestamp delta; #messages sent; #bytes sent; #throughput sent; #messages received; #bytes received; #throughput received; " \ 497 "timestamp; timestamp delta; #messages sent; #bytes sent; #throughput sent; #messages received; #bytes received; #throughput received; " \
495 "rtt; bw in; bw out; ats_cost_lan; ats_cost_wlan; ats_delay; ats_distance; ats_network_type; ats_utilization_up ;ats_utilization_down\n" , 498 "rtt; bw in; bw out; ats_cost_lan; ats_cost_wlan; ats_delay; ats_distance; ats_network_type; ats_utilization_up ;ats_utilization_down;" \
499 "pref bandwidth; pref delay\n",
496 c_m, c_s, experiment_name); 500 c_m, c_s, experiment_name);
497 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f[c_s], data, strlen(data))) 501 if (GNUNET_SYSERR == GNUNET_DISK_file_write(f[c_s], data, strlen(data)))
498 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 502 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -541,7 +545,7 @@ GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l,
541 545
542 /* Assembling slave string */ 546 /* Assembling slave string */
543 GNUNET_asprintf(&data, 547 GNUNET_asprintf(&data,
544 "%llu;%llu;%u;%u;%u;%u;%u;%u;%.3f;%u;%u;%u;%u;%u;%u;%u;%u;%u;%u;\n", 548 "%llu;%llu;%u;%u;%u;%u;%u;%u;%.3f;%u;%u;%u;%u;%u;%u;%u;%u;%u;%u;%.3f;%.3f\n",
545 (long long unsigned int) cur_lt->timestamp.abs_value_us, 549 (long long unsigned int) cur_lt->timestamp.abs_value_us,
546 (long long unsigned int) GNUNET_TIME_absolute_get_difference(l->lp[c_m].start, 550 (long long unsigned int) GNUNET_TIME_absolute_get_difference(l->lp[c_m].start,
547 cur_lt->timestamp).rel_value_us / 1000, 551 cur_lt->timestamp).rel_value_us / 1000,
@@ -561,7 +565,9 @@ GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l,
561 plt->ats_distance, 565 plt->ats_distance,
562 plt->ats_network_type, 566 plt->ats_network_type,
563 plt->ats_utilization_up, 567 plt->ats_utilization_up,
564 plt->ats_utilization_down); 568 plt->ats_utilization_down,
569 plt->pref_bandwidth,
570 plt->pref_delay);
565 571
566 if (l->verbose) 572 if (l->verbose)
567 fprintf (stderr, 573 fprintf (stderr,
@@ -743,6 +749,8 @@ GNUNET_ATS_TEST_logging_now (struct LoggingHandle *l)
743 slt->ats_utilization_up = p->ats_utilization_up; 749 slt->ats_utilization_up = p->ats_utilization_up;
744 slt->bandwidth_in = p->bandwidth_in; 750 slt->bandwidth_in = p->bandwidth_in;
745 slt->bandwidth_out = p->bandwidth_out; 751 slt->bandwidth_out = p->bandwidth_out;
752 slt->pref_bandwidth = p->pref_bandwidth;
753 slt->pref_delay = p->pref_delay;
746 754
747 /* Total application level rtt */ 755 /* Total application level rtt */
748 if (NULL == prev_log_mlt) 756 if (NULL == prev_log_mlt)
diff --git a/src/ats-tests/ats-testing-preferences.c b/src/ats-tests/ats-testing-preferences.c
index 2e140ae9a..ba45ec5e8 100644
--- a/src/ats-tests/ats-testing-preferences.c
+++ b/src/ats-tests/ats-testing-preferences.c
@@ -108,6 +108,17 @@ set_pref_task (void *cls,
108 GNUNET_ATS_performance_change_preference(p->me->ats_perf_handle, 108 GNUNET_ATS_performance_change_preference(p->me->ats_perf_handle,
109 &p->dest->id, p->pg->kind, pref_value, GNUNET_ATS_PREFERENCE_END); 109 &p->dest->id, p->pg->kind, pref_value, GNUNET_ATS_PREFERENCE_END);
110 110
111 switch (p->pg->kind) {
112 case GNUNET_ATS_PREFERENCE_BANDWIDTH:
113 p->pref_bandwidth = pref_value;
114 break;
115 case GNUNET_ATS_PREFERENCE_LATENCY:
116 p->pref_delay = pref_value;
117 break;
118 default:
119 break;
120 }
121
111 p->pg->set_task = GNUNET_SCHEDULER_add_delayed (p->pg->frequency, 122 p->pg->set_task = GNUNET_SCHEDULER_add_delayed (p->pg->frequency,
112 set_pref_task, p); 123 set_pref_task, p);
113 124
diff --git a/src/ats-tests/ats-testing.h b/src/ats-tests/ats-testing.h
index 15bf858f5..e91d37e62 100644
--- a/src/ats-tests/ats-testing.h
+++ b/src/ats-tests/ats-testing.h
@@ -339,6 +339,9 @@ struct BenchmarkPartner
339 uint32_t ats_cost_lan; 339 uint32_t ats_cost_lan;
340 340
341 uint32_t ats_cost_wlan; 341 uint32_t ats_cost_wlan;
342
343 double pref_bandwidth;
344 double pref_delay;
342}; 345};
343 346
344/** 347/**