set statistics
[oweals/gnunet.git] / src / set / gnunet-service-set.c
index 0557bc1f287f1ff800252214f649fc3a01e72527..cc172974ef979dda47cdff0925472a49ae88e294 100644 (file)
@@ -25,6 +25,7 @@
  */
 #include "gnunet-service-set.h"
 #include "gnunet-service-set_protocol.h"
+#include "gnunet_statistics_service.h"
 
 /**
  * How long do we hold on to an incoming channel if there is
@@ -137,6 +138,11 @@ static uint32_t lazy_copy_cookie = 1;
  */
 static uint32_t suggest_id = 1;
 
+/**
+ * Statistics handle.
+ */
+struct GNUNET_STATISTICS_Handle *_GSS_statistics;
+
 
 /**
  * Get set that is owned by the given client, if any.
@@ -1716,6 +1722,7 @@ shutdown_task (void *cls,
     GNUNET_CADET_disconnect (cadet);
     cadet = NULL;
   }
+  GNUNET_STATISTICS_destroy (_GSS_statistics, GNUNET_YES);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "handled shutdown request\n");
 }
@@ -1987,6 +1994,7 @@ run (void *cls,
                                    &handle_client_disconnect, NULL);
   GNUNET_SERVER_add_handlers (server,
                               server_handlers);
+  _GSS_statistics = GNUNET_STATISTICS_create ("set", cfg);
   cadet = GNUNET_CADET_connect (cfg, NULL,
                                 &channel_new_cb,
                                 &channel_end_cb,