diff options
author | Florian Dold <florian.dold@gmail.com> | 2015-10-07 18:05:23 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2015-10-07 18:05:23 +0000 |
commit | ca2a0be297732b8cd8b2f6635bc6be6d6a717860 (patch) | |
tree | 7531fcff29073f9edb2ae485221db7b6e0a43fb8 /src/set/gnunet-service-set_union.c | |
parent | dee73e0b5c185a16f2894ccdb3ddb20b0569c0a2 (diff) | |
download | gnunet-ca2a0be297732b8cd8b2f6635bc6be6d6a717860.tar.gz gnunet-ca2a0be297732b8cd8b2f6635bc6be6d6a717860.zip |
set statistics
Diffstat (limited to 'src/set/gnunet-service-set_union.c')
-rw-r--r-- | src/set/gnunet-service-set_union.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 2940c3c2d..04fbba348 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -24,6 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include "gnunet_util_lib.h" | 26 | #include "gnunet_util_lib.h" |
27 | #include "gnunet_statistics_service.h" | ||
27 | #include "gnunet-service-set.h" | 28 | #include "gnunet-service-set.h" |
28 | #include "ibf.h" | 29 | #include "ibf.h" |
29 | #include "gnunet-service-set_union_strata_estimator.h" | 30 | #include "gnunet-service-set_union_strata_estimator.h" |
@@ -796,10 +797,18 @@ decode_and_send (struct Operation *op) | |||
796 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 797 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
797 | "decoding failed, sending larger ibf (size %u)\n", | 798 | "decoding failed, sending larger ibf (size %u)\n", |
798 | 1<<next_order); | 799 | 1<<next_order); |
800 | GNUNET_STATISTICS_update (_GSS_statistics, | ||
801 | "# of IBF retries", | ||
802 | 1, | ||
803 | GNUNET_NO); | ||
799 | send_ibf (op, next_order); | 804 | send_ibf (op, next_order); |
800 | } | 805 | } |
801 | else | 806 | else |
802 | { | 807 | { |
808 | GNUNET_STATISTICS_update (_GSS_statistics, | ||
809 | "# of failed union operations (too large)", | ||
810 | 1, | ||
811 | GNUNET_NO); | ||
803 | // XXX: Send the whole set, element-by-element | 812 | // XXX: Send the whole set, element-by-element |
804 | LOG (GNUNET_ERROR_TYPE_ERROR, | 813 | LOG (GNUNET_ERROR_TYPE_ERROR, |
805 | "set union failed: reached ibf limit\n"); | 814 | "set union failed: reached ibf limit\n"); |
@@ -1094,10 +1103,19 @@ handle_p2p_elements (void *cls, | |||
1094 | (unsigned int) element_size, | 1103 | (unsigned int) element_size, |
1095 | GNUNET_h2s (&ee->element_hash)); | 1104 | GNUNET_h2s (&ee->element_hash)); |
1096 | 1105 | ||
1106 | GNUNET_STATISTICS_update (_GSS_statistics, | ||
1107 | "# received elements", | ||
1108 | 1, | ||
1109 | GNUNET_NO); | ||
1110 | |||
1097 | if (GNUNET_YES == op_has_element (op, &ee->element_hash)) | 1111 | if (GNUNET_YES == op_has_element (op, &ee->element_hash)) |
1098 | { | 1112 | { |
1099 | /* Got repeated element. Should not happen since | 1113 | /* Got repeated element. Should not happen since |
1100 | * we track demands. */ | 1114 | * we track demands. */ |
1115 | GNUNET_STATISTICS_update (_GSS_statistics, | ||
1116 | "# repeated elements", | ||
1117 | 1, | ||
1118 | GNUNET_NO); | ||
1101 | GNUNET_break (0); | 1119 | GNUNET_break (0); |
1102 | GNUNET_free (ee); | 1120 | GNUNET_free (ee); |
1103 | } | 1121 | } |
@@ -1379,6 +1397,10 @@ union_evaluate (struct Operation *op, | |||
1379 | op->state->phase = PHASE_EXPECT_SE; | 1397 | op->state->phase = PHASE_EXPECT_SE; |
1380 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1398 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1381 | "Initiating union operation evaluation\n"); | 1399 | "Initiating union operation evaluation\n"); |
1400 | GNUNET_STATISTICS_update (_GSS_statistics, | ||
1401 | "# of initiated union operations", | ||
1402 | 1, | ||
1403 | GNUNET_NO); | ||
1382 | ev = GNUNET_MQ_msg_nested_mh (msg, | 1404 | ev = GNUNET_MQ_msg_nested_mh (msg, |
1383 | GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, | 1405 | GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, |
1384 | opaque_context); | 1406 | opaque_context); |
@@ -1415,6 +1437,12 @@ union_accept (struct Operation *op) | |||
1415 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1437 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1416 | "accepting set union operation\n"); | 1438 | "accepting set union operation\n"); |
1417 | GNUNET_assert (NULL == op->state); | 1439 | GNUNET_assert (NULL == op->state); |
1440 | |||
1441 | GNUNET_STATISTICS_update (_GSS_statistics, | ||
1442 | "# of accepted union operations", | ||
1443 | 1, | ||
1444 | GNUNET_NO); | ||
1445 | |||
1418 | op->state = GNUNET_new (struct OperationState); | 1446 | op->state = GNUNET_new (struct OperationState); |
1419 | op->state->se = strata_estimator_dup (op->spec->set->state->se); | 1447 | op->state->se = strata_estimator_dup (op->spec->set->state->se); |
1420 | op->state->demanded_hashes = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); | 1448 | op->state->demanded_hashes = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |