aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/set/gnunet-service-set_intersection.c19
-rw-r--r--src/set/gnunet-service-set_union.c19
2 files changed, 32 insertions, 6 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 254763b45..1083384f5 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -23,6 +23,7 @@
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_util_lib.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_statistics_service.h"
26#include "gnunet-service-set.h" 27#include "gnunet-service-set.h"
27#include "gnunet_block_lib.h" 28#include "gnunet_block_lib.h"
28#include "gnunet-service-set_protocol.h" 29#include "gnunet-service-set_protocol.h"
@@ -215,6 +216,10 @@ send_client_removed_element (struct Operation *op,
215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
216 "Sending removed element (size %u) to client\n", 217 "Sending removed element (size %u) to client\n",
217 element->size); 218 element->size);
219 GNUNET_STATISTICS_update (_GSS_statistics,
220 "# Element removed messages sent",
221 1,
222 GNUNET_NO);
218 GNUNET_assert (0 != op->client_request_id); 223 GNUNET_assert (0 != op->client_request_id);
219 ev = GNUNET_MQ_msg_extra (rm, 224 ev = GNUNET_MQ_msg_extra (rm,
220 element->size, 225 element->size,
@@ -406,6 +411,10 @@ fail_intersection_operation (struct Operation *op)
406 411
407 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 412 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
408 "Intersection operation failed\n"); 413 "Intersection operation failed\n");
414 GNUNET_STATISTICS_update (_GSS_statistics,
415 "# Intersection operations failed",
416 1,
417 GNUNET_NO);
409 if (NULL != op->state->my_elements) 418 if (NULL != op->state->my_elements)
410 { 419 {
411 GNUNET_CONTAINER_multihashmap_destroy (op->state->my_elements); 420 GNUNET_CONTAINER_multihashmap_destroy (op->state->my_elements);
@@ -466,6 +475,10 @@ send_bloomfilter (struct Operation *op)
466 op); 475 op);
467 476
468 /* send our Bloom filter */ 477 /* send our Bloom filter */
478 GNUNET_STATISTICS_update (_GSS_statistics,
479 "# Intersection Bloom filters sent",
480 1,
481 GNUNET_NO);
469 chunk_size = 60 * 1024 - sizeof (struct BFMessage); 482 chunk_size = 60 * 1024 - sizeof (struct BFMessage);
470 if (bf_size <= chunk_size) 483 if (bf_size <= chunk_size)
471 { 484 {
@@ -534,6 +547,10 @@ send_client_done_and_destroy (void *cls)
534 547
535 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 548 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
536 "Intersection succeeded, sending DONE to local client\n"); 549 "Intersection succeeded, sending DONE to local client\n");
550 GNUNET_STATISTICS_update (_GSS_statistics,
551 "# Intersection operations succeeded",
552 1,
553 GNUNET_NO);
537 ev = GNUNET_MQ_msg (rm, 554 ev = GNUNET_MQ_msg (rm,
538 GNUNET_MESSAGE_TYPE_SET_RESULT); 555 GNUNET_MESSAGE_TYPE_SET_RESULT);
539 rm->request_id = htonl (op->client_request_id); 556 rm->request_id = htonl (op->client_request_id);
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index c3c14f1ba..c1268948a 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -758,8 +758,8 @@ get_order_from_difference (unsigned int diff)
758 */ 758 */
759static int 759static int
760send_full_element_iterator (void *cls, 760send_full_element_iterator (void *cls,
761 const struct GNUNET_HashCode *key, 761 const struct GNUNET_HashCode *key,
762 void *value) 762 void *value)
763{ 763{
764 struct Operation *op = cls; 764 struct Operation *op = cls;
765 struct GNUNET_SET_ElementMessage *emsg; 765 struct GNUNET_SET_ElementMessage *emsg;
@@ -1371,7 +1371,8 @@ send_client_element (struct Operation *op,
1371 * 1371 *
1372 * @param op operation 1372 * @param op operation
1373 */ 1373 */
1374void destroy_channel (struct Operation *op) 1374static void
1375destroy_channel (struct Operation *op)
1375{ 1376{
1376 struct GNUNET_CADET_Channel *channel; 1377 struct GNUNET_CADET_Channel *channel;
1377 1378
@@ -1404,7 +1405,11 @@ send_client_done (void *cls)
1404 1405
1405 if (PHASE_DONE != op->state->phase) { 1406 if (PHASE_DONE != op->state->phase) {
1406 LOG (GNUNET_ERROR_TYPE_WARNING, 1407 LOG (GNUNET_ERROR_TYPE_WARNING,
1407 "union operation failed\n"); 1408 "Union operation failed\n");
1409 GNUNET_STATISTICS_update (_GSS_statistics,
1410 "# Union operations failed",
1411 1,
1412 GNUNET_NO);
1408 ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT); 1413 ev = GNUNET_MQ_msg (rm, GNUNET_MESSAGE_TYPE_SET_RESULT);
1409 rm->result_status = htons (GNUNET_SET_STATUS_FAILURE); 1414 rm->result_status = htons (GNUNET_SET_STATUS_FAILURE);
1410 rm->request_id = htonl (op->client_request_id); 1415 rm->request_id = htonl (op->client_request_id);
@@ -1416,6 +1421,10 @@ send_client_done (void *cls)
1416 1421
1417 op->state->client_done_sent = GNUNET_YES; 1422 op->state->client_done_sent = GNUNET_YES;
1418 1423
1424 GNUNET_STATISTICS_update (_GSS_statistics,
1425 "# Union operations succeeded",
1426 1,
1427 GNUNET_NO);
1419 LOG (GNUNET_ERROR_TYPE_INFO, 1428 LOG (GNUNET_ERROR_TYPE_INFO,
1420 "Signalling client that union operation is done\n"); 1429 "Signalling client that union operation is done\n");
1421 ev = GNUNET_MQ_msg (rm, 1430 ev = GNUNET_MQ_msg (rm,