diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-27 08:26:36 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-04-27 08:26:36 +0000 |
commit | 2162a3697e647b74984520821b35df624cca1728 (patch) | |
tree | cabfda9f61ab18d49c1224bb9ce74768f4c473ff /src/transport/plugin_transport_unix.c | |
parent | 71ec640f202a7592c99869a835be531d562c431e (diff) | |
download | gnunet-2162a3697e647b74984520821b35df624cca1728.tar.gz gnunet-2162a3697e647b74984520821b35df624cca1728.zip |
- some statistics for the plugin
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r-- | src/transport/plugin_transport_unix.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index ecfe15783..c01304b3f 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -261,6 +261,11 @@ get_session_delete_it (void *cls, const GNUNET_HashCode * key, void *value) | |||
261 | GNUNET_assert (GNUNET_YES == | 261 | GNUNET_assert (GNUNET_YES == |
262 | GNUNET_CONTAINER_multihashmap_remove(plugin->session_map, &s->target.hashPubKey, s)); | 262 | GNUNET_CONTAINER_multihashmap_remove(plugin->session_map, &s->target.hashPubKey, s)); |
263 | 263 | ||
264 | GNUNET_STATISTICS_set(plugin->env->stats, | ||
265 | "# UNIX sessions active", | ||
266 | GNUNET_CONTAINER_multihashmap_size(plugin->session_map), | ||
267 | GNUNET_NO); | ||
268 | |||
264 | GNUNET_free (s); | 269 | GNUNET_free (s); |
265 | 270 | ||
266 | return GNUNET_YES; | 271 | return GNUNET_YES; |
@@ -544,6 +549,12 @@ unix_plugin_get_session (void *cls, | |||
544 | GNUNET_CONTAINER_multihashmap_put (plugin->session_map, | 549 | GNUNET_CONTAINER_multihashmap_put (plugin->session_map, |
545 | &address->peer.hashPubKey, s, | 550 | &address->peer.hashPubKey, s, |
546 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 551 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
552 | |||
553 | GNUNET_STATISTICS_set(plugin->env->stats, | ||
554 | "# UNIX sessions active", | ||
555 | GNUNET_CONTAINER_multihashmap_size(plugin->session_map), | ||
556 | GNUNET_NO); | ||
557 | |||
547 | #if DEBUG_UNIX | 558 | #if DEBUG_UNIX |
548 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating new session\n"); | 559 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating new session\n"); |
549 | #endif | 560 | #endif |
@@ -1071,6 +1082,7 @@ libgnunet_plugin_transport_unix_init (void *cls) | |||
1071 | api->string_to_address = NULL; // FIXME! | 1082 | api->string_to_address = NULL; // FIXME! |
1072 | return api; | 1083 | return api; |
1073 | } | 1084 | } |
1085 | GNUNET_assert( NULL != env->stats); | ||
1074 | 1086 | ||
1075 | if (GNUNET_OK != | 1087 | if (GNUNET_OK != |
1076 | GNUNET_CONFIGURATION_get_value_number (env->cfg, "transport-unix", "PORT", | 1088 | GNUNET_CONFIGURATION_get_value_number (env->cfg, "transport-unix", "PORT", |