[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30372 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30372 - gnunet/src/ats |
Date: |
Mon, 21 Oct 2013 07:46:43 +0200 |
Author: wachs
Date: 2013-10-21 07:46:43 +0200 (Mon, 21 Oct 2013)
New Revision: 30372
Modified:
gnunet/src/ats/test_ats_api_scheduling_add_address.c
gnunet/src/ats/test_ats_api_scheduling_add_address_duplicate.c
gnunet/src/ats/test_ats_api_scheduling_add_address_inbound.c
gnunet/src/ats/test_ats_api_scheduling_destroy_address.c
gnunet/src/ats/test_ats_api_scheduling_destroy_address_twice.c
gnunet/src/ats/test_ats_api_scheduling_destroy_session.c
Log:
adding initial statistics call
Modified: gnunet/src/ats/test_ats_api_scheduling_add_address.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_add_address.c 2013-10-20
18:04:56 UTC (rev 30371)
+++ gnunet/src/ats/test_ats_api_scheduling_add_address.c 2013-10-21
05:46:43 UTC (rev 30372)
@@ -150,14 +150,11 @@
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTING_Peer *peer)
+got_initial_value (void *cls, int success)
{
- die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
- stats = GNUNET_STATISTICS_create ("ats", cfg);
- GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got initial value\n");
/* Connect to ATS scheduling */
sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL);
@@ -190,9 +187,36 @@
/* Adding address */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session,
test_ats_info, test_ats_count);
+
}
+static int
+dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n",
+ is_persistent ? "!" : " ", subsystem, name, value);
+ return GNUNET_OK;
+}
+
+
+static void
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
+{
+ die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ stats = GNUNET_STATISTICS_create ("ats", cfg);
+ GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+
+ GNUNET_STATISTICS_get (stats, "ats", "# addresses", TIMEOUT,
+ &got_initial_value, &dummy_stat,
+ GNUNET_CONFIGURATION_dup (cfg));
+
+}
+
+
int
main (int argc, char *argv[])
{
Modified: gnunet/src/ats/test_ats_api_scheduling_add_address_duplicate.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_add_address_duplicate.c
2013-10-20 18:04:56 UTC (rev 30371)
+++ gnunet/src/ats/test_ats_api_scheduling_add_address_duplicate.c
2013-10-21 05:46:43 UTC (rev 30372)
@@ -160,15 +160,22 @@
}
+static int
+dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n",
+ is_persistent ? "!" : " ", subsystem, name, value);
+ return GNUNET_OK;
+}
+
+
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTING_Peer *peer)
+got_initial_value (void *cls, int success)
{
- die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
- stats = GNUNET_STATISTICS_create ("ats", cfg);
- GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got initial value\n");
/* Connect to ATS scheduling */
sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL);
@@ -203,9 +210,27 @@
GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session,
test_ats_info, test_ats_count);
/* Adding duplicate */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session,
test_ats_info, test_ats_count);
+
}
+static void
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
+{
+ die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ stats = GNUNET_STATISTICS_create ("ats", cfg);
+ GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+
+
+ GNUNET_STATISTICS_get (stats, "ats", "# addresses", TIMEOUT,
+ &got_initial_value, &dummy_stat,
+ GNUNET_CONFIGURATION_dup (cfg));
+
+}
+
+
int
main (int argc, char *argv[])
{
Modified: gnunet/src/ats/test_ats_api_scheduling_add_address_inbound.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_add_address_inbound.c
2013-10-20 18:04:56 UTC (rev 30371)
+++ gnunet/src/ats/test_ats_api_scheduling_add_address_inbound.c
2013-10-21 05:46:43 UTC (rev 30372)
@@ -156,15 +156,11 @@
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTING_Peer *peer)
+got_initial_value (void *cls, int success)
{
- die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
- stats = GNUNET_STATISTICS_create ("ats", cfg);
- GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
-
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got initial value\n");
/* Connect to ATS scheduling */
sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL);
if (sched_ats == NULL)
@@ -196,10 +192,34 @@
/* Adding address */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, NULL, test_ats_info,
test_ats_count);
GNUNET_ATS_address_add (sched_ats, &test_hello_address, NULL, test_ats_info,
test_ats_count);
+}
+static int
+dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n",
+ is_persistent ? "!" : " ", subsystem, name, value);
+ return GNUNET_OK;
}
+static void
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
+{
+ die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ stats = GNUNET_STATISTICS_create ("ats", cfg);
+ GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+
+ GNUNET_STATISTICS_get (stats, "ats", "# addresses", TIMEOUT,
+ &got_initial_value, &dummy_stat,
+ GNUNET_CONFIGURATION_dup (cfg));
+
+}
+
+
int
main (int argc, char *argv[])
{
Modified: gnunet/src/ats/test_ats_api_scheduling_destroy_address.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_destroy_address.c 2013-10-20
18:04:56 UTC (rev 30371)
+++ gnunet/src/ats/test_ats_api_scheduling_destroy_address.c 2013-10-21
05:46:43 UTC (rev 30372)
@@ -159,16 +159,12 @@
return;
}
-
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTING_Peer *peer)
+got_initial_value (void *cls, int success)
{
- die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
- stats = GNUNET_STATISTICS_create ("ats", cfg);
- GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got initial value\n");
/* Connect to ATS scheduling */
sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL);
@@ -198,9 +194,35 @@
/* Adding address */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session,
test_ats_info, test_ats_count);
+
}
+static int
+dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n",
+ is_persistent ? "!" : " ", subsystem, name, value);
+ return GNUNET_OK;
+}
+
+static void
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
+{
+ die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ stats = GNUNET_STATISTICS_create ("ats", cfg);
+ GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+
+
+ GNUNET_STATISTICS_get (stats, "ats", "# addresses", TIMEOUT,
+ &got_initial_value, &dummy_stat,
+ GNUNET_CONFIGURATION_dup (cfg));
+}
+
+
int
main (int argc, char *argv[])
{
Modified: gnunet/src/ats/test_ats_api_scheduling_destroy_address_twice.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_destroy_address_twice.c
2013-10-20 18:04:56 UTC (rev 30371)
+++ gnunet/src/ats/test_ats_api_scheduling_destroy_address_twice.c
2013-10-21 05:46:43 UTC (rev 30372)
@@ -161,16 +161,21 @@
return;
}
+static int
+dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n",
+ is_persistent ? "!" : " ", subsystem, name, value);
+ return GNUNET_OK;
+}
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTING_Peer *peer)
+got_initial_value (void *cls, int success)
{
- die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
- stats = GNUNET_STATISTICS_create ("ats", cfg);
- GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got initial value\n");
/* Connect to ATS scheduling */
sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL);
@@ -202,7 +207,21 @@
GNUNET_ATS_address_add (sched_ats, &test_hello_address, test_session,
test_ats_info, test_ats_count);
}
+static void
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
+{
+ die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ stats = GNUNET_STATISTICS_create ("ats", cfg);
+ GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ GNUNET_STATISTICS_get (stats, "ats", "# addresses", TIMEOUT,
+ &got_initial_value, &dummy_stat,
+ GNUNET_CONFIGURATION_dup (cfg));
+}
+
+
int
main (int argc, char *argv[])
{
Modified: gnunet/src/ats/test_ats_api_scheduling_destroy_session.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_destroy_session.c 2013-10-20
18:04:56 UTC (rev 30371)
+++ gnunet/src/ats/test_ats_api_scheduling_destroy_session.c 2013-10-21
05:46:43 UTC (rev 30372)
@@ -165,16 +165,12 @@
return;
}
-
static void
-run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TESTING_Peer *peer)
+got_initial_value (void *cls, int success)
{
- die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
- stats = GNUNET_STATISTICS_create ("ats", cfg);
- GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+ struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got initial value\n");
/* Connect to ATS scheduling */
sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL);
@@ -203,9 +199,36 @@
/* Adding address */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, NULL, test_ats_info,
test_ats_count);
+
}
+static int
+dummy_stat (void *cls, const char *subsystem, const char *name, uint64_t value,
+ int is_persistent)
+{
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Got dummy stat %s%s:%s = %llu\n",
+ is_persistent ? "!" : " ", subsystem, name, value);
+ return GNUNET_OK;
+}
+
+
+static void
+run (void *cls,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
+{
+ die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
+ stats = GNUNET_STATISTICS_create ("ats", cfg);
+ GNUNET_STATISTICS_watch (stats, "ats", "# addresses", &stat_cb, NULL);
+
+
+ GNUNET_STATISTICS_get (stats, "ats", "# addresses", TIMEOUT,
+ &got_initial_value, &dummy_stat,
+ GNUNET_CONFIGURATION_dup (cfg));
+}
+
+
int
main (int argc, char *argv[])
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30372 - gnunet/src/ats,
gnunet <=