summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/setu/gnunet-service-setu.c30
-rw-r--r--src/setu/perf_setu_api.c2
-rw-r--r--src/setu/setu.h1
3 files changed, 31 insertions, 2 deletions
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index 5799908ba..58717909e 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -666,15 +666,21 @@ struct perf_rtt_struct
struct perf_rtt_struct perf_rtt;
+static int
+sum_sent_received_bytes(int size, struct perf_num_send_resived_msg perf_rtt_struct) {
+ return (size * perf_rtt_struct.sent) + (size * perf_rtt_struct.received);
+}
+
static float
calculate_perf_rtt() {
/**
* Calculate RTT of init phase normally always 1
*/
float rtt = 1;
+ int bytes_transmitted = 0;
/**
- * Calculate RRT of Fullsync normaly 1 or 1.5 depending
+ * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending
*/
if (( perf_rtt.element_full.received != 0 ) ||
( perf_rtt.element_full.sent != 0)
@@ -694,6 +700,24 @@ calculate_perf_rtt() {
rtt += (iterations - 1 ) * 0.5;
rtt += 3 * iterations;
+ /**
+ * Calculate data sended size
+ */
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_REQUEST_FULL), perf_rtt.request_full);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_FULL_ELEMENT), perf_rtt.element_full);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_ELEMENTS), perf_rtt.element);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OPERATION_REQUEST), perf_rtt.operation_request);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_SE), perf_rtt.se);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_FULL_DONE), perf_rtt.full_done);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_IBF), perf_rtt.ibf);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_INQUIRY), perf_rtt.inquery);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DEMAND), perf_rtt.demand);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OFFER), perf_rtt.offer);
+ bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DONE), perf_rtt.done);
+
+ LOG(GNUNET_ERROR_TYPE_ERROR,"Bytes Transmitted: %d\n", bytes_transmitted);
+
+
return rtt;
}
@@ -1513,6 +1537,10 @@ handle_union_p2p_strata_estimator (void *cls,
return;
}
+ LOG (GNUNET_ERROR_TYPE_ERROR,
+ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: %f\n", op->rtt_bandwidth_tradeoff);
+
+
/**
* Added rtt_bandwidth_tradeoff directly need future improvements
*/
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index 73b61c02a..990e69ea8 100644
--- a/src/setu/perf_setu_api.c
+++ b/src/setu/perf_setu_api.c
@@ -395,7 +395,7 @@ run (void *cls,
"Running real set-reconciliation\n");
//init_set1 ();
// limit ~23800 element total
- initRandomSets(88,100,90,32);
+ initRandomSets(0,200,400,32);
}
static void execute_perf()
diff --git a/src/setu/setu.h b/src/setu/setu.h
index e9a0def95..f806c8eb1 100644
--- a/src/setu/setu.h
+++ b/src/setu/setu.h
@@ -121,6 +121,7 @@ struct GNUNET_SETU_AcceptMessage
* byzantine mode is enabled.
*/
uint32_t byzantine_lower_bound;
+
};