diff options
author | Elias Summermatter <elias.summermatter@seccom.ch> | 2021-04-07 12:29:22 +0200 |
---|---|---|
committer | Elias Summermatter <elias.summermatter@seccom.ch> | 2021-04-07 12:29:22 +0200 |
commit | 363822a820bcbe3351cd4eff94803ebdbfcad115 (patch) | |
tree | fd32cb1651dbdfadf601aa1687af23d3aeefdf6a /src/setu/gnunet-service-setu.c | |
parent | 03a045a53a3077027d23ef5a63918008f40746f5 (diff) | |
download | gnunet-363822a820bcbe3351cd4eff94803ebdbfcad115.tar.gz gnunet-363822a820bcbe3351cd4eff94803ebdbfcad115.zip |
Perf test with bytes send/resived per ibf
Diffstat (limited to 'src/setu/gnunet-service-setu.c')
-rw-r--r-- | src/setu/gnunet-service-setu.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index fcd0e425b..46a4f0386 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c | |||
@@ -728,13 +728,14 @@ sum_sent_received_bytes(int size, struct perf_num_send_resived_msg perf_rtt_stru | |||
728 | 728 | ||
729 | static float | 729 | static float |
730 | calculate_perf_rtt() { | 730 | calculate_perf_rtt() { |
731 | |||
732 | LOG(GNUNET_ERROR_TYPE_ERROR,"CALCUALATE PERFOMANCE VALUES\n"); | ||
731 | /** | 733 | /** |
732 | * Calculate RTT of init phase normally always 1 | 734 | * Calculate RTT of init phase normally always 1 |
733 | */ | 735 | */ |
734 | float rtt = 1; | 736 | float rtt = 1; |
735 | int bytes_transmitted = 0; | 737 | int bytes_transmitted = 0; |
736 | 738 | ||
737 | LOG(GNUNET_ERROR_TYPE_ERROR,"RTTTTTTTTTTTTTT1: %f \n", rtt); | ||
738 | /** | 739 | /** |
739 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending | 740 | * Calculate RGNUNET_SETU_AcceptMessageRT of Fullsync normaly 1 or 1.5 depending |
740 | */ | 741 | */ |
@@ -746,7 +747,6 @@ calculate_perf_rtt() { | |||
746 | ( perf_rtt.request_full.sent != 0) | 747 | ( perf_rtt.request_full.sent != 0) |
747 | ) rtt += 0.5; | 748 | ) rtt += 0.5; |
748 | 749 | ||
749 | LOG(GNUNET_ERROR_TYPE_ERROR,"RTTTTTTTTTTTTTT2: %f \n", rtt); | ||
750 | /** | 750 | /** |
751 | * In case of a differential sync 3 rtt's are needed. | 751 | * In case of a differential sync 3 rtt's are needed. |
752 | * for every active/passive switch additional 3.5 rtt's are used | 752 | * for every active/passive switch additional 3.5 rtt's are used |
@@ -758,7 +758,6 @@ calculate_perf_rtt() { | |||
758 | rtt += iterations * 0.5; | 758 | rtt += iterations * 0.5; |
759 | rtt += 2.5; | 759 | rtt += 2.5; |
760 | } | 760 | } |
761 | LOG(GNUNET_ERROR_TYPE_ERROR,"RTTTTTTTTTTTTTT3: %d \n", perf_rtt.active_passive_switches); | ||
762 | 761 | ||
763 | /** | 762 | /** |
764 | * Calculate data sended size | 763 | * Calculate data sended size |
@@ -775,9 +774,9 @@ calculate_perf_rtt() { | |||
775 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OFFER), perf_rtt.offer); | 774 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OFFER), perf_rtt.offer); |
776 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DONE), perf_rtt.done); | 775 | bytes_transmitted += sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DONE), perf_rtt.done); |
777 | 776 | ||
778 | LOG(GNUNET_ERROR_TYPE_ERROR,"Bytes Transmitted: %d\n", bytes_transmitted); | 777 | LOG(GNUNET_ERROR_TYPE_DEBUG,"Bytes Transmitted: %d\n", bytes_transmitted); |
779 | 778 | ||
780 | LOG(GNUNET_ERROR_TYPE_ERROR,"Reached tradeoff bandwidth/rtt: %f\n", (bytes_transmitted / rtt )); | 779 | LOG(GNUNET_ERROR_TYPE_DEBUG,"Reached tradeoff bandwidth/rtt: %f\n", (bytes_transmitted / rtt )); |
781 | 780 | ||
782 | LOG(GNUNET_ERROR_TYPE_ERROR,"Estimateded set difference: %d\n", perf_rtt.se_diff); | 781 | LOG(GNUNET_ERROR_TYPE_ERROR,"Estimateded set difference: %d\n", perf_rtt.se_diff); |
783 | 782 | ||
@@ -795,9 +794,12 @@ calculate_perf_rtt() { | |||
795 | int decoded = 0; | 794 | int decoded = 0; |
796 | if(perf_rtt.active_passive_switches == 0) | 795 | if(perf_rtt.active_passive_switches == 0) |
797 | decoded = 1; | 796 | decoded = 1; |
797 | LOG(GNUNET_ERROR_TYPE_ERROR,"decoded=%d, msg_sent=%d, msg_recv=%d, byte_sent=%d, bytes_recv=%d \n", decoded, perf_rtt.ibf.sent, perf_rtt.ibf.received, perf_rtt.ibf.sent_var_bytes, perf_rtt.ibf.received_var_bytes); | ||
798 | int ibf_bytes_transmitted = sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_IBF), perf_rtt.ibf); | ||
799 | |||
798 | 800 | ||
799 | FILE *out1 = fopen("perf_failure_bucket_number_factor.csv", "a"); | 801 | FILE *out1 = fopen("perf_failure_bucket_number_factor.csv", "a"); |
800 | fprintf(out1, "%d,%f,%d\n",num_per_bucket,factor,decoded); | 802 | fprintf(out1, "%d,%f,%d,%d\n",num_per_bucket,factor,decoded,ibf_bytes_transmitted); |
801 | fclose(out1); | 803 | fclose(out1); |
802 | 804 | ||
803 | 805 | ||
@@ -1605,9 +1607,10 @@ handle_union_p2p_strata_estimator (void *cls, | |||
1605 | 1607 | ||
1606 | perf_rtt.se_diff = diff; | 1608 | perf_rtt.se_diff = diff; |
1607 | 1609 | ||
1610 | /** | ||
1608 | if (diff > 200) | 1611 | if (diff > 200) |
1609 | diff = diff * 3 / 2; | 1612 | diff = diff * 3 / 2; |
1610 | 1613 | **/ | |
1611 | strata_estimator_destroy (remote_se); | 1614 | strata_estimator_destroy (remote_se); |
1612 | strata_estimator_destroy (op->se); | 1615 | strata_estimator_destroy (op->se); |
1613 | op->se = NULL; | 1616 | op->se = NULL; |
@@ -1643,6 +1646,7 @@ LOG (GNUNET_ERROR_TYPE_ERROR, "VALUE: %f\n ",op->max_set_diff_factor_diff_sync); | |||
1643 | /** | 1646 | /** |
1644 | * Added rtt_bandwidth_tradeoff directly need future improvements | 1647 | * Added rtt_bandwidth_tradeoff directly need future improvements |
1645 | */ | 1648 | */ |
1649 | LOG(GNUNET_ERROR_TYPE_ERROR,"((GNUNET_YES == %d) || (%d > %d * %f) || (0 == %d))", op->force_full,diff, op->initial_size, op->max_set_diff_factor_diff_sync, other_size); | ||
1646 | if ((GNUNET_YES == op->force_full) || | 1650 | if ((GNUNET_YES == op->force_full) || |
1647 | (diff > op->initial_size * op->max_set_diff_factor_diff_sync) || | 1651 | (diff > op->initial_size * op->max_set_diff_factor_diff_sync) || |
1648 | (0 == other_size)) | 1652 | (0 == other_size)) |
@@ -3851,7 +3855,12 @@ handle_client_accept (void *cls, | |||
3851 | perf_rtt.se.sent += 1; | 3855 | perf_rtt.se.sent += 1; |
3852 | perf_rtt.se.sent_var_bytes += len; | 3856 | perf_rtt.se.sent_var_bytes += len; |
3853 | 3857 | ||
3854 | if (len < se->strata_count * IBF_BUCKET_SIZE * se->ibf_size) | 3858 | GNUNET_log ( |
3859 | GNUNET_ERROR_TYPE_ERROR, | ||
3860 | "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); | ||
3861 | |||
3862 | |||
3863 | if (len < se->strata_count * IBF_BUCKET_SIZE * se->ibf_size) | ||
3855 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SEC; | 3864 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SEC; |
3856 | else | 3865 | else |
3857 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SE; | 3866 | type = GNUNET_MESSAGE_TYPE_SETU_P2P_SE; |