summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-17 19:43:02 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-17 19:43:02 +0000
commit5c3b8bfb02bbc5745383b4c6ea0be7823ddd9eb5 (patch)
tree8ec83e810ea1b7963fd96e50bb434043768172e8
parentfc91cb864ded72b193682d15667cc0ccfa8afc81 (diff)
add logging to watch for transmission delays within transport service
-rw-r--r--src/transport/gnunet-service-transport_clients.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c
index 3533b5f6d..12a5dc557 100644
--- a/src/transport/gnunet-service-transport_clients.c
+++ b/src/transport/gnunet-service-transport_clients.c
@@ -688,6 +688,11 @@ struct SendTransmitContinuationContext
* Peer that was the target.
*/
struct GNUNET_PeerIdentity target;
+
+ /**
+ * At what time did we receive the message?
+ */
+ struct GNUNET_TIME_Absolute send_time;
};
@@ -708,6 +713,27 @@ handle_send_transmit_continuation (void *cls,
{
struct SendTransmitContinuationContext *stcc = cls;
struct SendOkMessage send_ok_msg;
+ struct GNUNET_TIME_Relative delay;
+
+ delay = GNUNET_TIME_absolute_get_duration (stcc->send_time);
+ if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "It took us %s to send %u/%u bytes to %s (%d)\n",
+ GNUNET_STRINGS_relative_time_to_string (delay,
+ GNUNET_YES),
+ (unsigned int) bytes_payload,
+ (unsigned int) bytes_on_wire,
+ GNUNET_i2s (&stcc->target),
+ success);
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "It took us %s to send %u/%u bytes to %s (%d)\n",
+ GNUNET_STRINGS_relative_time_to_string (delay,
+ GNUNET_YES),
+ (unsigned int) bytes_payload,
+ (unsigned int) bytes_on_wire,
+ GNUNET_i2s (&stcc->target),
+ success);
if (GST_neighbours_test_connected (&stcc->target))
{
@@ -800,6 +826,7 @@ clients_handle_send (void *cls,
stcc = GNUNET_new (struct SendTransmitContinuationContext);
stcc->target = obm->peer;
stcc->client = client;
+ stcc->send_time = GNUNET_TIME_absolute_get ();
GNUNET_SERVER_client_keep (client);
GST_manipulation_send (&obm->peer,
obmm,