[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35513 - gnunet/src/ats-tests
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35513 - gnunet/src/ats-tests |
Date: |
Thu, 9 Apr 2015 12:08:55 +0200 |
Author: wachs
Date: 2015-04-09 12:08:55 +0200 (Thu, 09 Apr 2015)
New Revision: 35513
Modified:
gnunet/src/ats-tests/ats-testing-log.c
gnunet/src/ats-tests/ats-testing.c
gnunet/src/ats-tests/ats-testing.h
Log:
removing GNUNET_ATS_Information from ats-testing and logging
uses GNUNET_ATS_Properties instead
Modified: gnunet/src/ats-tests/ats-testing-log.c
===================================================================
--- gnunet/src/ats-tests/ats-testing-log.c 2015-04-09 08:31:59 UTC (rev
35512)
+++ gnunet/src/ats-tests/ats-testing-log.c 2015-04-09 10:08:55 UTC (rev
35513)
@@ -121,26 +121,20 @@
/* Current ATS properties */
- uint32_t ats_distance;
+ unsigned int ats_distance;
- uint32_t ats_delay;
+ struct GNUNET_TIME_Relative ats_delay;
uint32_t bandwidth_in;
uint32_t bandwidth_out;
- uint32_t ats_utilization_up;
+ uint32_t ats_utilization_out;
- uint32_t ats_utilization_down;
+ uint32_t ats_utilization_in;
- uint32_t ats_network_type;
+ enum GNUNET_ATS_Network_Type ats_network_type;
- uint32_t ats_cost_wan;
-
- uint32_t ats_cost_lan;
-
- uint32_t ats_cost_wlan;
-
double pref_bandwidth;
double pref_delay;
};
@@ -541,7 +535,7 @@
/* Assembling slave string */
GNUNET_asprintf(&data,
-
"%llu;%llu;%u;%u;%u;%u;%u;%u;%.3f;%u;%u;%u;%u;%u;%u;%u;%u;%u;%u;%.3f;%.3f\n",
+
"%llu;%llu;%u;%u;%u;%u;%u;%u;%.3f;%u;%u;%u;%u;%u;%u;%u;%.3f;%.3f\n",
(long long unsigned int) cur_lt->timestamp.abs_value_us,
(long long unsigned int)
GNUNET_TIME_absolute_get_difference(l->lp[c_m].start,
cur_lt->timestamp).rel_value_us / 1000,
@@ -554,20 +548,17 @@
(double) plt->app_rtt / 1000,
plt->bandwidth_in,
plt->bandwidth_out,
- plt->ats_cost_lan,
- plt->ats_cost_wan,
- plt->ats_cost_wlan,
plt->ats_delay,
plt->ats_distance,
plt->ats_network_type,
- plt->ats_utilization_up,
- plt->ats_utilization_down,
+ plt->ats_utilization_out,
+ plt->ats_utilization_in,
plt->pref_bandwidth,
plt->pref_delay);
if (l->verbose)
fprintf (stderr,
- "\t Slave [%u]: %u %u %u ; %u %u %u rtt %u delay %u bw_in %u
bw_out %u \n",
+ "\t Slave [%u]: %u %u %u ; %u %u %u rtt %u delay %llu bw_in %u
bw_out %u \n",
plt->slave->no,
plt->total_messages_sent,
plt->total_bytes_sent,
@@ -576,7 +567,7 @@
plt->total_bytes_received,
plt->throughput_recv,
plt->app_rtt,
- plt->ats_delay,
+ (long long unsigned int) plt->ats_delay.rel_value_us,
plt->bandwidth_in,
plt->bandwidth_out);
@@ -737,14 +728,11 @@
slt->total_messages_received = p->messages_received;
slt->total_app_rtt = p->total_app_rtt;
/* ats performance information */
- slt->ats_cost_lan = p->ats_cost_lan;
- slt->ats_cost_wan = p->ats_cost_wan;
- slt->ats_cost_wlan = p->ats_cost_wlan;
- slt->ats_delay = p->ats_delay;
- slt->ats_distance = p->ats_distance;
- slt->ats_network_type = p->ats_network_type;
- slt->ats_utilization_down = p->ats_utilization_down;
- slt->ats_utilization_up = p->ats_utilization_up;
+ slt->ats_delay = p->props.delay;
+ slt->ats_distance = p->props.distance;
+ slt->ats_network_type = p->props.scope;
+ slt->ats_utilization_in = p->props.utilization_out;
+ slt->ats_utilization_out = p->props.utilization_out;
slt->bandwidth_in = p->bandwidth_in;
slt->bandwidth_out = p->bandwidth_out;
slt->pref_bandwidth = p->pref_bandwidth;
Modified: gnunet/src/ats-tests/ats-testing.c
===================================================================
--- gnunet/src/ats-tests/ats-testing.c 2015-04-09 08:31:59 UTC (rev 35512)
+++ gnunet/src/ats-tests/ats-testing.c 2015-04-09 10:08:55 UTC (rev 35513)
@@ -548,8 +548,7 @@
int address_active,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- const struct GNUNET_ATS_Information *ats,
- uint32_t ats_count)
+ const struct GNUNET_ATS_Properties *ats_prop)
{
struct BenchmarkPeer *me = cls;
struct BenchmarkPartner *p;
@@ -574,55 +573,23 @@
p->bandwidth_in = ntohl (bandwidth_in.value__);
p->bandwidth_out = ntohl (bandwidth_out.value__);
- for (c_a = 0; c_a < ats_count; c_a++)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s [%u] received ATS information: %s
%s %u\n",
- (GNUNET_YES == p->me->master) ? "Master" : "Slave",
- p->me->no,
- GNUNET_i2s (&p->dest->id),
- GNUNET_ATS_print_property_type(ntohl(ats[c_a].type)),
- ntohl(ats[c_a].value));
- switch (ntohl (ats[c_a].type ))
- {
- case GNUNET_ATS_ARRAY_TERMINATOR:
- break;
- case GNUNET_ATS_UTILIZATION_OUT:
- if (p->ats_utilization_up != ntohl (ats[c_a].value))
- log = GNUNET_YES;
- p->ats_utilization_up = ntohl (ats[c_a].value);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s [%u] received ATS information:
%s\n",
+ (GNUNET_YES == p->me->master) ? "Master" : "Slave",
+ p->me->no,
+ GNUNET_i2s (&p->dest->id));
- break;
- case GNUNET_ATS_UTILIZATION_IN:
- if (p->ats_utilization_down != ntohl (ats[c_a].value))
- log = GNUNET_YES;
- p->ats_utilization_down = ntohl (ats[c_a].value);
- break;
- case GNUNET_ATS_NETWORK_TYPE:
- if (p->ats_network_type != ntohl (ats[c_a].value))
- log = GNUNET_YES;
- p->ats_network_type = ntohl (ats[c_a].value);
- break;
- case GNUNET_ATS_QUALITY_NET_DELAY:
- if (p->ats_delay != ntohl (ats[c_a].value))
- log = GNUNET_YES;
- p->ats_delay = ntohl (ats[c_a].value);
- break;
- case GNUNET_ATS_QUALITY_NET_DISTANCE:
- if (p->ats_distance != ntohl (ats[c_a].value))
- log = GNUNET_YES;
- p->ats_distance = ntohl (ats[c_a].value);
- GNUNET_break (0);
- break;
- default:
- break;
- }
- }
+ p->props.utilization_out = ats_prop->utilization_out;
+ p->props.utilization_in = ats_prop->utilization_in;
+ p->props.scope = ats_prop->scope;
+ p->props.delay = ats_prop->delay;
+ p->props.distance = ats_prop->distance;
+
if (GNUNET_YES == log)
top->ats_perf_cb (cls, address,
address_active,
bandwidth_out,
bandwidth_in,
- ats, ats_count);
+ ats_prop);
GNUNET_free(peer_id);
}
@@ -634,8 +601,7 @@
struct BenchmarkPeer *me = cls;
me->ats_perf_handle = GNUNET_ATS_performance_init (cfg,
- &ats_performance_info_cb,
- me);
+ &ats_performance_info_cb, me);
if (NULL == me->ats_perf_handle)
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
"Failed to create ATS performance handle \n");
@@ -797,6 +763,13 @@
{
top->sps[c_s].partners[c_m].me = &top->sps[c_s];
top->sps[c_s].partners[c_m].dest = &top->mps[c_m];
+
+ /* Initialize properties */
+ top->sps[c_s].partners[c_m].props.delay = GNUNET_TIME_UNIT_ZERO;
+ top->sps[c_s].partners[c_m].props.distance = 0;
+ top->sps[c_s].partners[c_m].props.scope = GNUNET_ATS_NET_UNSPECIFIED;
+ top->sps[c_s].partners[c_m].props.utilization_in = 0;
+ top->sps[c_s].partners[c_m].props.utilization_out = 0;
}
/* Get configuration */
top->sps[c_s].peer_id_op = GNUNET_TESTBED_peer_get_information
(top->sps[c_s].peer,
Modified: gnunet/src/ats-tests/ats-testing.h
===================================================================
--- gnunet/src/ats-tests/ats-testing.h 2015-04-09 08:31:59 UTC (rev 35512)
+++ gnunet/src/ats-tests/ats-testing.h 2015-04-09 10:08:55 UTC (rev 35513)
@@ -283,7 +283,15 @@
*/
struct GNUNET_TRANSPORT_TransmitHandle *tth;
+
+ /**
+ * Handle for traffic generator
+ */
struct TrafficGenerator *tg;
+
+ /**
+ * Handle for preference generator
+ */
struct PreferenceGenerator *pg;
/**
@@ -317,29 +325,21 @@
unsigned int bytes_received;
/* Current ATS properties */
+ struct GNUNET_ATS_Properties props;
- uint32_t ats_distance;
-
- uint32_t ats_delay;
-
+ /* Bandwidth assigned inbound */
uint32_t bandwidth_in;
+ /* Bandwidth assigned outbound */
uint32_t bandwidth_out;
- uint32_t ats_utilization_up;
+ /* Current preference values for bandwidth */
+ double pref_bandwidth;
- uint32_t ats_utilization_down;
+ /* Current preference values for delay */
+ double pref_delay;
- uint32_t ats_network_type;
- uint32_t ats_cost_wan;
-
- uint32_t ats_cost_lan;
-
- uint32_t ats_cost_wlan;
-
- double pref_bandwidth;
- double pref_delay;
};
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35513 - gnunet/src/ats-tests,
gnunet <=