gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 02/06: Get statistics values from within sampler


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 02/06: Get statistics values from within sampler
Date: Wed, 29 Aug 2018 15:43:46 +0200

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a commit to branch master
in repository gnunet.

commit dc24eb644d7b04bde12f93feadd3ada13f0656cd
Author: Julius Bünger <address@hidden>
AuthorDate: Wed Aug 29 12:30:13 2018 +0200

    Get statistics values from within sampler
---
 src/rps/gnunet-service-rps.c         |  2 +-
 src/rps/gnunet-service-rps_sampler.c | 11 ++++++++++-
 src/rps/rps.h                        |  7 ++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 37b6a6fab..0b3befdcf 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -61,7 +61,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
 /**
  * Handle to the statistics service.
  */
-static struct GNUNET_STATISTICS_Handle *stats;
+struct GNUNET_STATISTICS_Handle *stats;
 
 /**
  * Our own identity.
diff --git a/src/rps/gnunet-service-rps_sampler.c 
b/src/rps/gnunet-service-rps_sampler.c
index 20b2d3420..e07fe1f3c 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -23,6 +23,7 @@
  */
 #include "platform.h"
 #include "gnunet_util_lib.h"
+#include "gnunet_statistics_service.h"
 #include "rps.h"
 
 #include "gnunet-service-rps_sampler.h"
@@ -636,7 +637,15 @@ sampler_mod_get_rand_peer (void *cls)
     // TODO add other reasons to wait here
   }
 
-  s_elem->last_client_request = GNUNET_TIME_absolute_get ();
+  GNUNET_STATISTICS_set (stats,
+                         "# client sampler element input",
+                         s_elem->num_peers,
+                         GNUNET_NO);
+  GNUNET_STATISTICS_set (stats,
+                         "# client sampler element change",
+                         s_elem->num_change,
+                         GNUNET_NO);
+
   RPS_sampler_elem_reinit (s_elem);
 
   GNUNET_CONTAINER_DLL_remove (gpc->req_handle->gpc_head,
diff --git a/src/rps/rps.h b/src/rps/rps.h
index 6bf2273b4..58ba79082 100644
--- a/src/rps/rps.h
+++ b/src/rps/rps.h
@@ -216,6 +216,7 @@ struct GNUNET_RPS_CS_DEBUG_ViewReply
 };
   /* Followed by num_peers * GNUNET_PeerIdentity */
 
+GNUNET_NETWORK_STRUCT_END
 
 /***********************************************************************
  * Defines from old gnunet-service-rps_peers.h
@@ -312,4 +313,8 @@ typedef int
                   const struct GNUNET_PeerIdentity *peer);
 
 
-GNUNET_NETWORK_STRUCT_END
+/**
+ * Handle to the statistics service.
+ */
+extern struct GNUNET_STATISTICS_Handle *stats;
+

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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