diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-19 13:26:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-19 13:26:44 +0000 |
commit | 64fda257bdaf166ed3d96dce3a01ea14017a2a3e (patch) | |
tree | e33c077dcb46d06755fb4d0b37f829d7f6a0731e /src/statistics/statistics_api.c | |
parent | 08f1726b6552ac29830637e9f7be4d42e2ea4294 (diff) | |
download | gnunet-64fda257bdaf166ed3d96dce3a01ea14017a2a3e.tar.gz gnunet-64fda257bdaf166ed3d96dce3a01ea14017a2a3e.zip |
misc minor fixes for new service MQ API, implementing resolver using new service API
Diffstat (limited to 'src/statistics/statistics_api.c')
-rw-r--r-- | src/statistics/statistics_api.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index c8709145b..856873d00 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c | |||
@@ -295,12 +295,18 @@ update_memory_statistics (struct GNUNET_STATISTICS_Handle *h) | |||
295 | if (current_heap_size > h->peak_heap_size) | 295 | if (current_heap_size > h->peak_heap_size) |
296 | { | 296 | { |
297 | h->peak_heap_size = current_heap_size; | 297 | h->peak_heap_size = current_heap_size; |
298 | GNUNET_STATISTICS_set (h, "# peak heap size", current_heap_size, GNUNET_NO); | 298 | GNUNET_STATISTICS_set (h, |
299 | "# peak heap size", | ||
300 | current_heap_size, | ||
301 | GNUNET_NO); | ||
299 | } | 302 | } |
300 | if (current_rss > h->peak_rss) | 303 | if (current_rss > h->peak_rss) |
301 | { | 304 | { |
302 | h->peak_rss = current_rss; | 305 | h->peak_rss = current_rss; |
303 | GNUNET_STATISTICS_set (h, "# peak resident set size", current_rss, GNUNET_NO); | 306 | GNUNET_STATISTICS_set (h, |
307 | "# peak resident set size", | ||
308 | current_rss, | ||
309 | GNUNET_NO); | ||
304 | } | 310 | } |
305 | #endif | 311 | #endif |
306 | } | 312 | } |
@@ -739,7 +745,8 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h) | |||
739 | */ | 745 | */ |
740 | loss = GNUNET_NO; | 746 | loss = GNUNET_NO; |
741 | for (gh = h->action_head; NULL != gh; gh = gh->next) | 747 | for (gh = h->action_head; NULL != gh; gh = gh->next) |
742 | if ( (gh->make_persistent) && (ACTION_SET == gh->type) ) | 748 | if ( (gh->make_persistent) && |
749 | (ACTION_SET == gh->type) ) | ||
743 | loss = GNUNET_YES; | 750 | loss = GNUNET_YES; |
744 | if (GNUNET_YES == loss) | 751 | if (GNUNET_YES == loss) |
745 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 752 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -922,8 +929,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | |||
922 | GNUNET_assert (GNUNET_NO == h->do_destroy); /* Don't call twice. */ | 929 | GNUNET_assert (GNUNET_NO == h->do_destroy); /* Don't call twice. */ |
923 | if ( (sync_first) && | 930 | if ( (sync_first) && |
924 | (NULL != h->mq) && | 931 | (NULL != h->mq) && |
925 | (0 != GNUNET_MQ_get_length (h->mq)) && | 932 | (0 != GNUNET_MQ_get_length (h->mq)) ) |
926 | (GNUNET_YES == try_connect (h)) ) | ||
927 | { | 933 | { |
928 | if ( (NULL != h->current) && | 934 | if ( (NULL != h->current) && |
929 | (ACTION_GET == h->current->type) ) | 935 | (ACTION_GET == h->current->type) ) |
@@ -933,8 +939,7 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | |||
933 | { | 939 | { |
934 | next = pos->next; | 940 | next = pos->next; |
935 | if ( (ACTION_GET == pos->type) || | 941 | if ( (ACTION_GET == pos->type) || |
936 | (ACTION_WATCH == pos->type) || | 942 | (ACTION_WATCH == pos->type) ) |
937 | (GNUNET_NO == pos->make_persistent) ) | ||
938 | { | 943 | { |
939 | GNUNET_CONTAINER_DLL_remove (h->action_head, | 944 | GNUNET_CONTAINER_DLL_remove (h->action_head, |
940 | h->action_tail, | 945 | h->action_tail, |
@@ -1009,7 +1014,7 @@ schedule_action (void *cls) | |||
1009 | reconnect_later (h); | 1014 | reconnect_later (h); |
1010 | return; | 1015 | return; |
1011 | } | 1016 | } |
1012 | if (0 < GNUNET_MQ_get_length (h->mq) ) | 1017 | if (0 < GNUNET_MQ_get_length (h->mq)) |
1013 | return; /* Wait for queue to be reduced more */ | 1018 | return; /* Wait for queue to be reduced more */ |
1014 | /* schedule next action */ | 1019 | /* schedule next action */ |
1015 | while (NULL == h->current) | 1020 | while (NULL == h->current) |
@@ -1200,8 +1205,10 @@ GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle, | |||
1200 | continue; | 1205 | continue; |
1201 | if ( (w->proc == proc) && | 1206 | if ( (w->proc == proc) && |
1202 | (w->proc_cls == proc_cls) && | 1207 | (w->proc_cls == proc_cls) && |
1203 | (0 == strcmp (w->name, name)) && | 1208 | (0 == strcmp (w->name, |
1204 | (0 == strcmp (w->subsystem, subsystem)) ) | 1209 | name)) && |
1210 | (0 == strcmp (w->subsystem, | ||
1211 | subsystem)) ) | ||
1205 | { | 1212 | { |
1206 | GNUNET_free (w->name); | 1213 | GNUNET_free (w->name); |
1207 | GNUNET_free (w->subsystem); | 1214 | GNUNET_free (w->subsystem); |
@@ -1291,8 +1298,10 @@ add_setter_action (struct GNUNET_STATISTICS_Handle *h, | |||
1291 | ai->type = type; | 1298 | ai->type = type; |
1292 | } | 1299 | } |
1293 | } | 1300 | } |
1294 | ai->timeout = GNUNET_TIME_relative_to_absolute (SET_TRANSMIT_TIMEOUT); | 1301 | ai->timeout |
1295 | ai->make_persistent = make_persistent; | 1302 | = GNUNET_TIME_relative_to_absolute (SET_TRANSMIT_TIMEOUT); |
1303 | ai->make_persistent | ||
1304 | = make_persistent; | ||
1296 | return; | 1305 | return; |
1297 | } | 1306 | } |
1298 | /* no existing entry matches, create a fresh one */ | 1307 | /* no existing entry matches, create a fresh one */ |