gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27266 - gnunet/src/experimentation


From: gnunet
Subject: [GNUnet-SVN] r27266 - gnunet/src/experimentation
Date: Thu, 23 May 2013 13:38:57 +0200

Author: wachs
Date: 2013-05-23 13:38:57 +0200 (Thu, 23 May 2013)
New Revision: 27266

Modified:
   gnunet/src/experimentation/gnunet-daemon-experimentation.c
   gnunet/src/experimentation/gnunet-daemon-experimentation.h
   gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
Log:
use GSE_stat as extern



Modified: gnunet/src/experimentation/gnunet-daemon-experimentation.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation.c  2013-05-23 
11:28:50 UTC (rev 27265)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation.c  2013-05-23 
11:38:57 UTC (rev 27266)
@@ -31,7 +31,7 @@
 #include "gnunet_statistics_service.h"
 #include "gnunet-daemon-experimentation.h"
 
-static struct GNUNET_STATISTICS_Handle *GSE_stats;
+struct GNUNET_STATISTICS_Handle *GSE_stats;
 
 /**
  * Task run during shutdown.

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation.h
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation.h  2013-05-23 
11:28:50 UTC (rev 27265)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation.h  2013-05-23 
11:38:57 UTC (rev 27266)
@@ -36,6 +36,7 @@
  */
 #define EXP_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 10)
 
+extern struct GNUNET_STATISTICS_Handle *GSE_stats;
 
 /**
  * A experimentation node

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-05-23 11:28:50 UTC (rev 27265)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-05-23 11:38:57 UTC (rev 27266)
@@ -35,8 +35,6 @@
 
 static struct GNUNET_PeerIdentity me;
 
-static struct GNUNET_STATISTICS_Handle *stats;
-
 /**
  * Nodes with a pending request
  */
@@ -58,21 +56,21 @@
 static void update_stats (struct GNUNET_CONTAINER_MultiHashMap *m)
 {
        GNUNET_assert (NULL != m);
-       GNUNET_assert (NULL != stats);
+       GNUNET_assert (NULL != GSE_stats);
 
        if (m == nodes_active)
        {
-                       GNUNET_STATISTICS_set (stats, "# nodes active",
+                       GNUNET_STATISTICS_set (GSE_stats, "# nodes active",
                                        GNUNET_CONTAINER_multihashmap_size(m), 
GNUNET_NO);
        }
        else if (m == nodes_inactive)
        {
-                       GNUNET_STATISTICS_set (stats, "# nodes inactive",
+                       GNUNET_STATISTICS_set (GSE_stats, "# nodes inactive",
                                        GNUNET_CONTAINER_multihashmap_size(m), 
GNUNET_NO);
        }
        else if (m == nodes_requested)
        {
-                       GNUNET_STATISTICS_set (stats, "# nodes requested",
+                       GNUNET_STATISTICS_set (GSE_stats, "# nodes requested",
                                        GNUNET_CONTAINER_multihashmap_size(m), 
GNUNET_NO);
        }
        else
@@ -414,13 +412,6 @@
 void
 GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle 
*cfg)
 {
-       stats = GNUNET_STATISTICS_create ("experimentation", cfg);
-       if (NULL == stats)
-       {
-               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to create 
statistics!\n"));
-               return;
-       }
-
        /* Connecting to core service to find partners */
        ch = GNUNET_CORE_connect (cfg, NULL,
                                                                                
                                &core_startup_handler,
@@ -480,12 +471,6 @@
                GNUNET_CONTAINER_multihashmap_destroy (nodes_inactive);
                nodes_inactive = NULL;
   }
-
-  if (NULL != stats)
-  {
-               GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
-               stats = NULL;
-  }
 }
 
 /* end of gnunet-daemon-experimentation_nodes.c */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]