summaryrefslogtreecommitdiff
path: root/src/setu/gnunet-service-setu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setu/gnunet-service-setu.c')
-rw-r--r--src/setu/gnunet-service-setu.c30
1 files changed, 29 insertions, 1 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
*/