diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-07-27 12:48:54 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-07-27 12:48:54 +0000 |
commit | 0f80cc6bb4c838a9987f7ad1325642b5f0133b86 (patch) | |
tree | bbbdac2f8464983ca3926bf4a01fb3b7f5b0229a /src/nse | |
parent | 2692cd41f52623b3599bbf9c8b5aa8572f7b90e8 (diff) | |
download | gnunet-0f80cc6bb4c838a9987f7ad1325642b5f0133b86.tar.gz gnunet-0f80cc6bb4c838a9987f7ad1325642b5f0133b86.zip |
timestamps
Diffstat (limited to 'src/nse')
-rw-r--r-- | src/nse/gnunet-service-nse.c | 1 | ||||
-rw-r--r-- | src/nse/nse-profiler.c | 6 | ||||
-rw-r--r-- | src/nse/nse.h | 5 | ||||
-rw-r--r-- | src/nse/nse_api.c | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index a926c1f23..04ddf5041 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -332,6 +332,7 @@ setup_estimate_message (struct GNUNET_NSE_ClientMessage *em) | |||
332 | em->header.type | 332 | em->header.type |
333 | = htons (GNUNET_MESSAGE_TYPE_NSE_ESTIMATE); | 333 | = htons (GNUNET_MESSAGE_TYPE_NSE_ESTIMATE); |
334 | em->reserved = htonl (0); | 334 | em->reserved = htonl (0); |
335 | em->timestamp = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get()); | ||
335 | em->size_estimate = mean - 1.0/3.0; | 336 | em->size_estimate = mean - 1.0/3.0; |
336 | em->std_deviation = std_dev; | 337 | em->std_deviation = std_dev; |
337 | GNUNET_STATISTICS_set (stats, | 338 | GNUNET_STATISTICS_set (stats, |
diff --git a/src/nse/nse-profiler.c b/src/nse/nse-profiler.c index 3b7371ccc..8ca1b8ed9 100644 --- a/src/nse/nse-profiler.c +++ b/src/nse/nse-profiler.c | |||
@@ -197,13 +197,14 @@ shutdown_task (void *cls, | |||
197 | * Callback to call when network size estimate is updated. | 197 | * Callback to call when network size estimate is updated. |
198 | * | 198 | * |
199 | * @param cls closure | 199 | * @param cls closure |
200 | * @param timestamp server timestamp | ||
200 | * @param estimate the value of the current network size estimate | 201 | * @param estimate the value of the current network size estimate |
201 | * @param std_dev standard deviation (rounded down to nearest integer) | 202 | * @param std_dev standard deviation (rounded down to nearest integer) |
202 | * of the size estimation values seen | 203 | * of the size estimation values seen |
203 | * | 204 | * |
204 | */ | 205 | */ |
205 | static void | 206 | static void |
206 | handle_estimate (void *cls, double estimate, double std_dev) | 207 | handle_estimate (void *cls, struct GNUNET_TIME_AbsoluteNBO timestamp, double estimate, double std_dev) |
207 | { | 208 | { |
208 | struct NSEPeer *peer = cls; | 209 | struct NSEPeer *peer = cls; |
209 | char *output_buffer; | 210 | char *output_buffer; |
@@ -212,9 +213,10 @@ handle_estimate (void *cls, double estimate, double std_dev) | |||
212 | if (output_file != NULL) | 213 | if (output_file != NULL) |
213 | { | 214 | { |
214 | size = GNUNET_asprintf(&output_buffer, | 215 | size = GNUNET_asprintf(&output_buffer, |
215 | "%s %u %f %f %f\n", | 216 | "%s %u %llu %f %f %f\n", |
216 | GNUNET_i2s(&peer->daemon->id), | 217 | GNUNET_i2s(&peer->daemon->id), |
217 | peers_running, | 218 | peers_running, |
219 | GNUNET_TIME_absolute_ntoh(timestamp).abs_value, | ||
218 | pow(2, estimate), | 220 | pow(2, estimate), |
219 | estimate, | 221 | estimate, |
220 | std_dev); | 222 | std_dev); |
diff --git a/src/nse/nse.h b/src/nse/nse.h index 24001e8cc..45748b1f3 100644 --- a/src/nse/nse.h +++ b/src/nse/nse.h | |||
@@ -55,6 +55,11 @@ struct GNUNET_NSE_ClientMessage | |||
55 | uint32_t reserved; | 55 | uint32_t reserved; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Timestamp at which the server received the message. | ||
59 | */ | ||
60 | struct GNUNET_TIME_AbsoluteNBO timestamp; | ||
61 | |||
62 | /** | ||
58 | * The current estimated network size. | 63 | * The current estimated network size. |
59 | */ | 64 | */ |
60 | double size_estimate; | 65 | double size_estimate; |
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c index a50cd5a41..c986b7ff4 100644 --- a/src/nse/nse_api.c +++ b/src/nse/nse_api.c | |||
@@ -122,6 +122,7 @@ message_handler (void *cls, | |||
122 | } | 122 | } |
123 | client_msg = (const struct GNUNET_NSE_ClientMessage *)msg; | 123 | client_msg = (const struct GNUNET_NSE_ClientMessage *)msg; |
124 | h->recv_cb (h->recv_cb_cls, | 124 | h->recv_cb (h->recv_cb_cls, |
125 | client_msg->timestamp, | ||
125 | client_msg->size_estimate, | 126 | client_msg->size_estimate, |
126 | client_msg->std_deviation); | 127 | client_msg->std_deviation); |
127 | GNUNET_CLIENT_receive (h->client, | 128 | GNUNET_CLIENT_receive (h->client, |