[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16241 - gnunet/src/nse
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16241 - gnunet/src/nse |
Date: |
Wed, 27 Jul 2011 14:48:54 +0200 |
Author: nevans
Date: 2011-07-27 14:48:54 +0200 (Wed, 27 Jul 2011)
New Revision: 16241
Modified:
gnunet/src/nse/gnunet-service-nse.c
gnunet/src/nse/nse-profiler.c
gnunet/src/nse/nse.h
gnunet/src/nse/nse_api.c
Log:
timestamps
Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2011-07-27 12:41:00 UTC (rev 16240)
+++ gnunet/src/nse/gnunet-service-nse.c 2011-07-27 12:48:54 UTC (rev 16241)
@@ -332,6 +332,7 @@
em->header.type
= htons (GNUNET_MESSAGE_TYPE_NSE_ESTIMATE);
em->reserved = htonl (0);
+ em->timestamp = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get());
em->size_estimate = mean - 1.0/3.0;
em->std_deviation = std_dev;
GNUNET_STATISTICS_set (stats,
Modified: gnunet/src/nse/nse-profiler.c
===================================================================
--- gnunet/src/nse/nse-profiler.c 2011-07-27 12:41:00 UTC (rev 16240)
+++ gnunet/src/nse/nse-profiler.c 2011-07-27 12:48:54 UTC (rev 16241)
@@ -197,13 +197,14 @@
* Callback to call when network size estimate is updated.
*
* @param cls closure
+ * @param timestamp server timestamp
* @param estimate the value of the current network size estimate
* @param std_dev standard deviation (rounded down to nearest integer)
* of the size estimation values seen
*
*/
static void
-handle_estimate (void *cls, double estimate, double std_dev)
+handle_estimate (void *cls, struct GNUNET_TIME_AbsoluteNBO timestamp, double
estimate, double std_dev)
{
struct NSEPeer *peer = cls;
char *output_buffer;
@@ -212,9 +213,10 @@
if (output_file != NULL)
{
size = GNUNET_asprintf(&output_buffer,
- "%s %u %f %f %f\n",
+ "%s %u %llu %f %f %f\n",
GNUNET_i2s(&peer->daemon->id),
peers_running,
+ GNUNET_TIME_absolute_ntoh(timestamp).abs_value,
pow(2, estimate),
estimate,
std_dev);
Modified: gnunet/src/nse/nse.h
===================================================================
--- gnunet/src/nse/nse.h 2011-07-27 12:41:00 UTC (rev 16240)
+++ gnunet/src/nse/nse.h 2011-07-27 12:48:54 UTC (rev 16241)
@@ -55,6 +55,11 @@
uint32_t reserved;
/**
+ * Timestamp at which the server received the message.
+ */
+ struct GNUNET_TIME_AbsoluteNBO timestamp;
+
+ /**
* The current estimated network size.
*/
double size_estimate;
Modified: gnunet/src/nse/nse_api.c
===================================================================
--- gnunet/src/nse/nse_api.c 2011-07-27 12:41:00 UTC (rev 16240)
+++ gnunet/src/nse/nse_api.c 2011-07-27 12:48:54 UTC (rev 16241)
@@ -122,6 +122,7 @@
}
client_msg = (const struct GNUNET_NSE_ClientMessage *)msg;
h->recv_cb (h->recv_cb_cls,
+ client_msg->timestamp,
client_msg->size_estimate,
client_msg->std_deviation);
GNUNET_CLIENT_receive (h->client,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16241 - gnunet/src/nse,
gnunet <=