diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 37c99b8ef..d53cef95e 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -1031,6 +1031,10 @@ struct ATS_info | |||
1031 | */ | 1031 | */ |
1032 | struct ATS_peer * peers; | 1032 | struct ATS_peer * peers; |
1033 | 1033 | ||
1034 | int successful_executions; | ||
1035 | |||
1036 | int invalid_executions; | ||
1037 | |||
1034 | /** | 1038 | /** |
1035 | * Maximum number of LP iterations per calculation | 1039 | * Maximum number of LP iterations per calculation |
1036 | */ | 1040 | */ |
@@ -5984,18 +5988,18 @@ static int ats_evaluate_results (int result, int solution, char * problem) | |||
5984 | 5988 | ||
5985 | switch (result) { | 5989 | switch (result) { |
5986 | case GLP_ESTOP : /* search terminated by application */ | 5990 | case GLP_ESTOP : /* search terminated by application */ |
5987 | GNUNET_log (error_kind, "%s , Search terminated by application ", problem); | 5991 | GNUNET_log (error_kind, "%s , Search terminated by application\n", problem); |
5988 | break; | 5992 | break; |
5989 | case GLP_EITLIM : /* iteration limit exceeded */ | 5993 | case GLP_EITLIM : /* iteration limit exceeded */ |
5990 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s Iteration limit exceeded ", problem); | 5994 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s Iteration limit exceeded\n", problem); |
5991 | break; | 5995 | break; |
5992 | break; | 5996 | break; |
5993 | case GLP_ETMLIM : /* time limit exceeded */ | 5997 | case GLP_ETMLIM : /* time limit exceeded */ |
5994 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s Time limit exceeded ", problem); | 5998 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s Time limit exceeded\n", problem); |
5995 | break; | 5999 | break; |
5996 | case GLP_ENOPFS : /* no primal feasible solution */ | 6000 | case GLP_ENOPFS : /* no primal feasible solution */ |
5997 | case GLP_ENODFS : /* no dual feasible solution */ | 6001 | case GLP_ENODFS : /* no dual feasible solution */ |
5998 | GNUNET_log (error_kind, "%s No feasible solution", problem); | 6002 | GNUNET_log (error_kind, "%s No feasible solution\n", problem); |
5999 | break; | 6003 | break; |
6000 | 6004 | ||
6001 | case GLP_EBADB : /* invalid basis */ | 6005 | case GLP_EBADB : /* invalid basis */ |
@@ -6872,6 +6876,7 @@ static void | |||
6872 | ats_calculate_bandwidth_distribution () | 6876 | ats_calculate_bandwidth_distribution () |
6873 | { | 6877 | { |
6874 | #if HAVE_LIBGLPK | 6878 | #if HAVE_LIBGLPK |
6879 | #endif | ||
6875 | struct GNUNET_TIME_Absolute start; | 6880 | struct GNUNET_TIME_Absolute start; |
6876 | struct GNUNET_TIME_Relative creation; | 6881 | struct GNUNET_TIME_Relative creation; |
6877 | struct GNUNET_TIME_Relative solving; | 6882 | struct GNUNET_TIME_Relative solving; |
@@ -6894,7 +6899,7 @@ ats_calculate_bandwidth_distribution () | |||
6894 | ats->simplex_rerun_required = GNUNET_NO; | 6899 | ats->simplex_rerun_required = GNUNET_NO; |
6895 | 6900 | ||
6896 | start = GNUNET_TIME_absolute_get(); | 6901 | start = GNUNET_TIME_absolute_get(); |
6897 | if ((ats->modified_addr == GNUNET_YES) || (ats->prob==NULL)) | 6902 | if ((ats->modified_addr == GNUNET_YES) || (ats->prob==NULL) || (ats->stat.valid == GNUNET_NO)) |
6898 | { | 6903 | { |
6899 | text = "new"; | 6904 | text = "new"; |
6900 | ats->modified_addr = GNUNET_YES; | 6905 | ats->modified_addr = GNUNET_YES; |
@@ -6938,6 +6943,8 @@ ats_calculate_bandwidth_distribution () | |||
6938 | ats->stat.c_mechs, | 6943 | ats->stat.c_mechs, |
6939 | (ats->simplex_rerun_required == GNUNET_NO) ? " NO" : "YES"); | 6944 | (ats->simplex_rerun_required == GNUNET_NO) ? " NO" : "YES"); |
6940 | #endif | 6945 | #endif |
6946 | ats->successful_executions ++; | ||
6947 | GNUNET_STATISTICS_set (stats, "# ATS successful executions", ats->successful_executions, GNUNET_NO); | ||
6941 | GNUNET_STATISTICS_set (stats, "ATS duration", solving.rel_value + creation.rel_value, GNUNET_NO); | 6948 | GNUNET_STATISTICS_set (stats, "ATS duration", solving.rel_value + creation.rel_value, GNUNET_NO); |
6942 | GNUNET_STATISTICS_set (stats, "ATS mechanisms", ats->stat.c_mechs, GNUNET_NO); | 6949 | GNUNET_STATISTICS_set (stats, "ATS mechanisms", ats->stat.c_mechs, GNUNET_NO); |
6943 | GNUNET_STATISTICS_set (stats, "ATS peers", ats->stat.c_peers, GNUNET_NO); | 6950 | GNUNET_STATISTICS_set (stats, "ATS peers", ats->stat.c_peers, GNUNET_NO); |
@@ -6960,6 +6967,11 @@ ats_calculate_bandwidth_distribution () | |||
6960 | else if (ats->simplex_rerun_required == GNUNET_NO) | 6967 | else if (ats->simplex_rerun_required == GNUNET_NO) |
6961 | GNUNET_STATISTICS_set (stats, "ATS state", ATS_UNMODIFIED, GNUNET_NO); | 6968 | GNUNET_STATISTICS_set (stats, "ATS state", ATS_UNMODIFIED, GNUNET_NO); |
6962 | } | 6969 | } |
6970 | else | ||
6971 | { | ||
6972 | ats->invalid_executions ++; | ||
6973 | GNUNET_STATISTICS_set (stats, "# ATS invalid executions", ats->invalid_executions, GNUNET_NO); | ||
6974 | } | ||
6963 | 6975 | ||
6964 | if ((ats->save_mlp == GNUNET_YES) && (ats->stat.c_mechs >= ats->dump_min_peers) && (ats->stat.c_mechs >= ats->dump_min_addr)) | 6976 | if ((ats->save_mlp == GNUNET_YES) && (ats->stat.c_mechs >= ats->dump_min_peers) && (ats->stat.c_mechs >= ats->dump_min_addr)) |
6965 | { | 6977 | { |
@@ -6999,7 +7011,7 @@ ats_calculate_bandwidth_distribution () | |||
6999 | ats->modified_addr = GNUNET_NO; | 7011 | ats->modified_addr = GNUNET_NO; |
7000 | ats->modified_resources = GNUNET_NO; | 7012 | ats->modified_resources = GNUNET_NO; |
7001 | ats->modified_quality = GNUNET_NO; | 7013 | ats->modified_quality = GNUNET_NO; |
7002 | #endif | 7014 | |
7003 | } | 7015 | } |
7004 | 7016 | ||
7005 | static void | 7017 | static void |
@@ -7123,7 +7135,8 @@ void ats_init () | |||
7123 | GNUNET_CONFIGURATION_get_value_number(cfg, "transport","ATS_MIN_INTERVAL", &value); | 7135 | GNUNET_CONFIGURATION_get_value_number(cfg, "transport","ATS_MIN_INTERVAL", &value); |
7124 | ats->min_delta.rel_value = value; | 7136 | ats->min_delta.rel_value = value; |
7125 | } | 7137 | } |
7126 | 7138 | ats->successful_executions = 0; | |
7139 | ats->invalid_executions = 0; | ||
7127 | ats->ats_task = GNUNET_SCHEDULER_add_now(&ats_schedule_calculation, ats); | 7140 | ats->ats_task = GNUNET_SCHEDULER_add_now(&ats_schedule_calculation, ats); |
7128 | } | 7141 | } |
7129 | 7142 | ||