[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26613 - in gnunet/src: dht fs include nse testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26613 - in gnunet/src: dht fs include nse testbed |
Date: |
Tue, 26 Mar 2013 17:39:54 +0100 |
Author: harsha
Date: 2013-03-26 17:39:54 +0100 (Tue, 26 Mar 2013)
New Revision: 26613
Modified:
gnunet/src/dht/test_dht_topo.c
gnunet/src/fs/gnunet-fs-profiler.c
gnunet/src/include/gnunet_testbed_service.h
gnunet/src/nse/gnunet-nse-profiler.c
gnunet/src/testbed/test_testbed_api_statistics.c
gnunet/src/testbed/testbed_api_statistics.c
Log:
- allow getting statistics of a particular subsystem and name in testbed
Modified: gnunet/src/dht/test_dht_topo.c
===================================================================
--- gnunet/src/dht/test_dht_topo.c 2013-03-26 15:02:37 UTC (rev 26612)
+++ gnunet/src/dht/test_dht_topo.c 2013-03-26 16:39:54 UTC (rev 26613)
@@ -239,6 +239,7 @@
}
(void) GNUNET_TESTBED_get_statistics (NUM_PEERS,
my_peers,
+ NULL, NULL,
&handle_stats,
&stats_finished,
ctx);
Modified: gnunet/src/fs/gnunet-fs-profiler.c
===================================================================
--- gnunet/src/fs/gnunet-fs-profiler.c 2013-03-26 15:02:37 UTC (rev 26612)
+++ gnunet/src/fs/gnunet-fs-profiler.c 2013-03-26 16:39:54 UTC (rev 26613)
@@ -117,6 +117,7 @@
{
terminate_taskid = GNUNET_SCHEDULER_NO_TASK;
GNUNET_TESTBED_get_statistics (0, NULL,
+ NULL, NULL,
&process_stats,
&shutdown_task,
NULL);
Modified: gnunet/src/include/gnunet_testbed_service.h
===================================================================
--- gnunet/src/include/gnunet_testbed_service.h 2013-03-26 15:02:37 UTC (rev
26612)
+++ gnunet/src/include/gnunet_testbed_service.h 2013-03-26 16:39:54 UTC (rev
26613)
@@ -1339,6 +1339,8 @@
*
* @param num_peers number of peers to iterate over
* @param peers array of peers to iterate over
+ * @param subsystem limit to the specified subsystem, NULL for all subsystems
+ * @param name name of the statistic value, NULL for all values
* @param proc processing function for each statistic retrieved
* @param cont continuation to call once call is completed. The completion of
this
* operation is *ONLY* signalled through this callback -- no
@@ -1349,6 +1351,7 @@
struct GNUNET_TESTBED_Operation *
GNUNET_TESTBED_get_statistics (unsigned int num_peers,
struct GNUNET_TESTBED_Peer **peers,
+ const char *subsystem, const char *name,
GNUNET_TESTBED_StatisticsIterator proc,
GNUNET_TESTBED_OperationCompletionCallback cont,
void *cls);
Modified: gnunet/src/nse/gnunet-nse-profiler.c
===================================================================
--- gnunet/src/nse/gnunet-nse-profiler.c 2013-03-26 15:02:37 UTC (rev
26612)
+++ gnunet/src/nse/gnunet-nse-profiler.c 2013-03-26 16:39:54 UTC (rev
26613)
@@ -633,8 +633,9 @@
close_monitor_connections ();
stats_context = GNUNET_malloc (sizeof (struct StatsContext));
get_stats_op =
- GNUNET_TESTBED_get_statistics (num_peers_in_round[current_round],
- daemons,
+ GNUNET_TESTBED_get_statistics (num_peers_in_round[current_round],
+ daemons,
+ NULL, NULL,
&statistics_iterator,
&stats_finished_callback,
stats_context);
Modified: gnunet/src/testbed/test_testbed_api_statistics.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_statistics.c 2013-03-26 15:02:37 UTC
(rev 26612)
+++ gnunet/src/testbed/test_testbed_api_statistics.c 2013-03-26 16:39:54 UTC
(rev 26613)
@@ -160,6 +160,7 @@
FAIL_TEST (NUM_PEERS == num_peers, return);
peers = peers_;
op = GNUNET_TESTBED_get_statistics (num_peers, peers,
+ NULL, NULL,
&stats_iterator,
&op_comp_cb,
dummy_cls);
Modified: gnunet/src/testbed/testbed_api_statistics.c
===================================================================
--- gnunet/src/testbed/testbed_api_statistics.c 2013-03-26 15:02:37 UTC (rev
26612)
+++ gnunet/src/testbed/testbed_api_statistics.c 2013-03-26 16:39:54 UTC (rev
26613)
@@ -66,6 +66,16 @@
struct GNUNET_TESTBED_Peer **peers;
/**
+ * The subsystem of peers for which statistics are requested
+ */
+ char *subsystem;
+
+ /**
+ * The particular statistics value of interest
+ */
+ char *name;
+
+ /**
* The iterator to call with statistics information
*/
GNUNET_TESTBED_StatisticsIterator proc;
@@ -253,10 +263,10 @@
{
struct PeerGetStatsContext *peer_sc = cls;
struct GNUNET_STATISTICS_Handle *h = ca_result;
-
+
LOG_DEBUG ("Retrieving statistics of peer %u\n", peer_sc->peer_index);
peer_sc->get_handle =
- GNUNET_STATISTICS_get (h, NULL, NULL,
+ GNUNET_STATISTICS_get (h, peer_sc->sc->subsystem, peer_sc->sc->name,
GNUNET_TIME_UNIT_FOREVER_REL,
&iteration_completion_cb,
iterator_cb, peer_sc);
@@ -370,6 +380,8 @@
}
GNUNET_free (sc->ops);
}
+ GNUNET_free_non_null (sc->subsystem);
+ GNUNET_free_non_null (sc->name);
GNUNET_free (sc);
if (GNUNET_YES ==
GNUNET_TESTBED_operation_queue_destroy_empty_ (no_wait_queue))
@@ -383,6 +395,8 @@
*
* @param num_peers number of peers to iterate over
* @param peers array of peers to iterate over
+ * @param subsystem limit to the specified subsystem, NULL for all subsystems
+ * @param name name of the statistic value, NULL for all values
* @param proc processing function for each statistic retrieved
* @param cont continuation to call once call is completed(?)
* @param cls closure to pass to proc and cont
@@ -391,6 +405,7 @@
struct GNUNET_TESTBED_Operation *
GNUNET_TESTBED_get_statistics (unsigned int num_peers,
struct GNUNET_TESTBED_Peer **peers,
+ const char *subsystem, const char *name,
GNUNET_TESTBED_StatisticsIterator proc,
GNUNET_TESTBED_OperationCompletionCallback cont,
void *cls)
@@ -404,6 +419,8 @@
GNUNET_TESTBED_operation_queue_create_ (UINT_MAX);
sc = GNUNET_malloc (sizeof (struct GetStatsContext));
sc->peers = peers;
+ sc->subsystem = (NULL == subsystem) ? NULL : GNUNET_strdup (subsystem);
+ sc->name = (NULL == name) ? NULL : GNUNET_strdup (name);
sc->proc = proc;
sc->cont = cont;
sc->cb_cls = cls;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26613 - in gnunet/src: dht fs include nse testbed,
gnunet <=