diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-05-15 16:47:24 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-05-15 16:47:24 +0000 |
commit | ce9e30e59c5d84f5f267a4b3d52026b0cbfa2b23 (patch) | |
tree | b9586ca4487e8fbb5f532e3f00a47997890162ab /src/ats | |
parent | ce1503504938a762f94eeb20d5cc16ed1bd9c6c2 (diff) | |
download | gnunet-ce9e30e59c5d84f5f267a4b3d52026b0cbfa2b23.tar.gz gnunet-ce9e30e59c5d84f5f267a4b3d52026b0cbfa2b23.zip |
log if peer is requested
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.c | 12 | ||||
-rw-r--r-- | src/ats/gnunet-ats-solver-eval.h | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c index 5a97b2e58..3feb9b54e 100644 --- a/src/ats/gnunet-ats-solver-eval.c +++ b/src/ats/gnunet-ats-solver-eval.c | |||
@@ -199,6 +199,7 @@ GNUNET_ATS_solver_logging_now (struct LoggingHandle *l) | |||
199 | log_p = GNUNET_new (struct LoggingPeer); | 199 | log_p = GNUNET_new (struct LoggingPeer); |
200 | log_p->id = cur->id; | 200 | log_p->id = cur->id; |
201 | log_p->peer_id = cur->peer_id; | 201 | log_p->peer_id = cur->peer_id; |
202 | log_p->is_requested = cur->is_requested; | ||
202 | for (c = 0; c < GNUNET_ATS_PreferenceCount; c++) | 203 | for (c = 0; c < GNUNET_ATS_PreferenceCount; c++) |
203 | { | 204 | { |
204 | log_p->pref_abs[c] = cur->pref_abs[c]; | 205 | log_p->pref_abs[c] = cur->pref_abs[c]; |
@@ -383,7 +384,7 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int add_time_s | |||
383 | GNUNET_free (filename); | 384 | GNUNET_free (filename); |
384 | GNUNET_CONTAINER_DLL_insert (lf_head, lf_tail, cur); | 385 | GNUNET_CONTAINER_DLL_insert (lf_head, lf_tail, cur); |
385 | 386 | ||
386 | GNUNET_asprintf(&datastring,"#time delta;log duration; addr net; addr_active; bw in; bw out; " \ | 387 | GNUNET_asprintf(&datastring,"#time delta;log duration;peer_requested;addr net; addr_active; bw in; bw out; " \ |
387 | "UTILIZATION_UP [abs/rel]; UTILIZATION_UP; UTILIZATION_DOWN; UTILIZATION_DOWN; " \ | 388 | "UTILIZATION_UP [abs/rel]; UTILIZATION_UP; UTILIZATION_DOWN; UTILIZATION_DOWN; " \ |
388 | "UTILIZATION_PAYLOAD_UP; UTILIZATION_PAYLOAD_UP; UTILIZATION_PAYLOAD_DOWN; UTILIZATION_PAYLOAD_DOWN;"\ | 389 | "UTILIZATION_PAYLOAD_UP; UTILIZATION_PAYLOAD_UP; UTILIZATION_PAYLOAD_DOWN; UTILIZATION_PAYLOAD_DOWN;"\ |
389 | "DELAY; DELAY; " \ | 390 | "DELAY; DELAY; " \ |
@@ -427,10 +428,12 @@ GNUNET_ATS_solver_logging_write_to_disk (struct LoggingHandle *l, int add_time_s | |||
427 | propstring = GNUNET_strdup(propstring_tmp); | 428 | propstring = GNUNET_strdup(propstring_tmp); |
428 | GNUNET_free (propstring_tmp); | 429 | GNUNET_free (propstring_tmp); |
429 | } | 430 | } |
430 | 431 | if (GNUNET_YES==log_p->is_requested) | |
431 | GNUNET_asprintf(&datastring,"%llu;%llu;%u;%i;%u;%u;%s;%s\n", | 432 | GNUNET_break (0); |
433 | GNUNET_asprintf(&datastring,"%llu;%llu;%u;%u;%i;%u;%u;%s;%s\n", | ||
432 | GNUNET_TIME_absolute_get_difference(l->head->timestamp, lts->timestamp).rel_value_us / 1000, | 434 | GNUNET_TIME_absolute_get_difference(l->head->timestamp, lts->timestamp).rel_value_us / 1000, |
433 | lts->delta, | 435 | lts->delta, |
436 | log_p->is_requested, | ||
434 | log_a->network, | 437 | log_a->network, |
435 | log_a->active, | 438 | log_a->active, |
436 | ntohl (log_a->assigned_bw_in.value__), | 439 | ntohl (log_a->assigned_bw_in.value__), |
@@ -2279,6 +2282,7 @@ enforce_start_request (struct GNUNET_ATS_TEST_Operation *op) | |||
2279 | 2282 | ||
2280 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Requesting address for peer %u\n", | 2283 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Requesting address for peer %u\n", |
2281 | op->peer_id); | 2284 | op->peer_id); |
2285 | p->is_requested = GNUNET_YES; | ||
2282 | 2286 | ||
2283 | res = sh->env.sf.s_get (sh->solver, &p->peer_id); | 2287 | res = sh->env.sf.s_get (sh->solver, &p->peer_id); |
2284 | if (NULL != res) | 2288 | if (NULL != res) |
@@ -2307,7 +2311,7 @@ enforce_stop_request (struct GNUNET_ATS_TEST_Operation *op) | |||
2307 | 2311 | ||
2308 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stop requesting address for peer %u\n", | 2312 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stop requesting address for peer %u\n", |
2309 | op->peer_id); | 2313 | op->peer_id); |
2310 | 2314 | p->is_requested = GNUNET_NO; | |
2311 | sh->env.sf.s_get_stop (sh->solver, &p->peer_id); | 2315 | sh->env.sf.s_get_stop (sh->solver, &p->peer_id); |
2312 | 2316 | ||
2313 | if (NULL != l) | 2317 | if (NULL != l) |
diff --git a/src/ats/gnunet-ats-solver-eval.h b/src/ats/gnunet-ats-solver-eval.h index 05c3c89ff..35f8fe7b3 100644 --- a/src/ats/gnunet-ats-solver-eval.h +++ b/src/ats/gnunet-ats-solver-eval.h | |||
@@ -122,6 +122,7 @@ struct LoggingPeer | |||
122 | struct GNUNET_PeerIdentity peer_id; | 122 | struct GNUNET_PeerIdentity peer_id; |
123 | double pref_abs[GNUNET_ATS_PreferenceCount]; | 123 | double pref_abs[GNUNET_ATS_PreferenceCount]; |
124 | double pref_norm[GNUNET_ATS_PreferenceCount]; | 124 | double pref_norm[GNUNET_ATS_PreferenceCount]; |
125 | int is_requested; | ||
125 | 126 | ||
126 | struct LoggingAddress *addr_head; | 127 | struct LoggingAddress *addr_head; |
127 | struct LoggingAddress *addr_tail; | 128 | struct LoggingAddress *addr_tail; |
@@ -149,7 +150,9 @@ struct TestPeer | |||
149 | struct TestPeer *prev; | 150 | struct TestPeer *prev; |
150 | struct TestPeer *next; | 151 | struct TestPeer *next; |
151 | 152 | ||
153 | |||
152 | long long unsigned int id; | 154 | long long unsigned int id; |
155 | int is_requested; | ||
153 | struct GNUNET_PeerIdentity peer_id; | 156 | struct GNUNET_PeerIdentity peer_id; |
154 | 157 | ||
155 | double pref_abs[GNUNET_ATS_PreferenceCount]; | 158 | double pref_abs[GNUNET_ATS_PreferenceCount]; |