diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-29 19:33:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-29 19:33:03 +0000 |
commit | dfabdccb41fb04d6aaddbc8b5329b88ad56e3fc1 (patch) | |
tree | 90aaaa6796401e89ba85684c9c479cc0a375485f /src/transport | |
parent | 74b8150b6c0669ae5ef21fe89f2769747b8dea71 (diff) | |
download | gnunet-dfabdccb41fb04d6aaddbc8b5329b88ad56e3fc1.tar.gz gnunet-dfabdccb41fb04d6aaddbc8b5329b88ad56e3fc1.zip |
report disconnect reasons in stats
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 26bf3771c..a391ff572 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -523,6 +523,10 @@ neighbour_timeout_task (void *cls, | |||
523 | struct NeighbourMapEntry *n = cls; | 523 | struct NeighbourMapEntry *n = cls; |
524 | 524 | ||
525 | n->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 525 | n->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
526 | if (GNUNET_YES == n->is_connected) | ||
527 | GNUNET_STATISTICS_update (GST_stats, | ||
528 | gettext_noop ("# peers disconnected due to timeout"), 1, | ||
529 | GNUNET_NO); | ||
526 | disconnect_neighbour (n); | 530 | disconnect_neighbour (n); |
527 | } | 531 | } |
528 | 532 | ||
@@ -543,6 +547,10 @@ disconnect_all_neighbours (void *cls, const GNUNET_HashCode * key, void *value) | |||
543 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n", | 547 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s', %s\n", |
544 | GNUNET_i2s (&n->id), "SHUTDOWN_TASK"); | 548 | GNUNET_i2s (&n->id), "SHUTDOWN_TASK"); |
545 | #endif | 549 | #endif |
550 | if (GNUNET_YES == n->is_connected) | ||
551 | GNUNET_STATISTICS_update (GST_stats, | ||
552 | gettext_noop ("# peers disconnected due to global disconnect"), 1, | ||
553 | GNUNET_NO); | ||
546 | disconnect_neighbour (n); | 554 | disconnect_neighbour (n); |
547 | return GNUNET_OK; | 555 | return GNUNET_OK; |
548 | } | 556 | } |
@@ -1022,9 +1030,10 @@ GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, | |||
1022 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n", | 1030 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s' due to `%s'\n", |
1023 | GNUNET_i2s (&n->id), "SET_QUOTA"); | 1031 | GNUNET_i2s (&n->id), "SET_QUOTA"); |
1024 | #endif | 1032 | #endif |
1025 | GNUNET_STATISTICS_update (GST_stats, | 1033 | if (GNUNET_YES == n->is_connected) |
1026 | gettext_noop ("# disconnects due to quota of 0"), 1, | 1034 | GNUNET_STATISTICS_update (GST_stats, |
1027 | GNUNET_NO); | 1035 | gettext_noop ("# disconnects due to quota of 0"), 1, |
1036 | GNUNET_NO); | ||
1028 | disconnect_neighbour (n); | 1037 | disconnect_neighbour (n); |
1029 | } | 1038 | } |
1030 | 1039 | ||
@@ -1126,6 +1135,9 @@ GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target) | |||
1126 | UINT32_MAX /* priority */ , | 1135 | UINT32_MAX /* priority */ , |
1127 | GNUNET_TIME_UNIT_FOREVER_REL, n->session, n->addr, n->addrlen, | 1136 | GNUNET_TIME_UNIT_FOREVER_REL, n->session, n->addr, n->addrlen, |
1128 | GNUNET_YES, NULL, NULL); | 1137 | GNUNET_YES, NULL, NULL); |
1138 | GNUNET_STATISTICS_update (GST_stats, | ||
1139 | gettext_noop ("# peers disconnected due to external request"), 1, | ||
1140 | GNUNET_NO); | ||
1129 | } | 1141 | } |
1130 | disconnect_neighbour (n); | 1142 | disconnect_neighbour (n); |
1131 | } | 1143 | } |