diff options
Diffstat (limited to 'src/ats-tests/perf_ats.h')
-rw-r--r-- | src/ats-tests/perf_ats.h | 256 |
1 files changed, 0 insertions, 256 deletions
diff --git a/src/ats-tests/perf_ats.h b/src/ats-tests/perf_ats.h deleted file mode 100644 index 6460aa098..000000000 --- a/src/ats-tests/perf_ats.h +++ /dev/null | |||
@@ -1,256 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2010-2013 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | /** | ||
21 | * @file ats/perf_ats.c | ||
22 | * @brief ats benchmark: start peers and modify preferences, monitor change over time | ||
23 | * @author Christian Grothoff | ||
24 | * @author Matthias Wachs | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | #include "gnunet_testbed_service.h" | ||
29 | #include "gnunet_ats_service.h" | ||
30 | #include "gnunet_core_service.h" | ||
31 | #include "ats-testing.h" | ||
32 | |||
33 | #define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, \ | ||
34 | 120) | ||
35 | #define BENCHMARK_DURATION GNUNET_TIME_relative_multiply ( \ | ||
36 | GNUNET_TIME_UNIT_SECONDS, 10) | ||
37 | #define LOGGING_FREQUENCY GNUNET_TIME_relative_multiply ( \ | ||
38 | GNUNET_TIME_UNIT_MILLISECONDS, 500) | ||
39 | #define TESTNAME_PREFIX "perf_ats_" | ||
40 | #define DEFAULT_SLAVES_NUM 2 | ||
41 | #define DEFAULT_MASTERS_NUM 1 | ||
42 | |||
43 | #define TEST_ATS_PREFRENCE_FREQUENCY GNUNET_TIME_relative_multiply ( \ | ||
44 | GNUNET_TIME_UNIT_SECONDS, 1) | ||
45 | #define TEST_ATS_PREFRENCE_START 1.0 | ||
46 | #define TEST_ATS_PREFRENCE_DELTA 1.0 | ||
47 | |||
48 | #define TEST_MESSAGE_TYPE_PING 12345 | ||
49 | #define TEST_MESSAGE_TYPE_PONG 12346 | ||
50 | #define TEST_MESSAGE_SIZE 1000 | ||
51 | #define TEST_MESSAGE_FREQUENCY GNUNET_TIME_relative_multiply ( \ | ||
52 | GNUNET_TIME_UNIT_SECONDS, 1) | ||
53 | |||
54 | /** | ||
55 | * Information about a benchmarking partner | ||
56 | */ | ||
57 | struct BenchmarkPartner | ||
58 | { | ||
59 | /** | ||
60 | * The peer itself this partner belongs to | ||
61 | */ | ||
62 | struct BenchmarkPeer *me; | ||
63 | |||
64 | /** | ||
65 | * The partner peer | ||
66 | */ | ||
67 | struct BenchmarkPeer *dest; | ||
68 | |||
69 | /** | ||
70 | * Core transmit handles | ||
71 | */ | ||
72 | struct GNUNET_CORE_TransmitHandle *cth; | ||
73 | |||
74 | /** | ||
75 | * Transport transmit handles | ||
76 | */ | ||
77 | struct GNUNET_TRANSPORT_TransmitHandle *tth; | ||
78 | |||
79 | /** | ||
80 | * Timestamp to calculate communication layer delay | ||
81 | */ | ||
82 | struct GNUNET_TIME_Absolute last_message_sent; | ||
83 | |||
84 | /** | ||
85 | * Accumulated RTT for all messages | ||
86 | */ | ||
87 | unsigned int total_app_rtt; | ||
88 | |||
89 | /** | ||
90 | * Number of messages sent to this partner | ||
91 | */ | ||
92 | unsigned int messages_sent; | ||
93 | |||
94 | /** | ||
95 | * Number of bytes sent to this partner | ||
96 | */ | ||
97 | unsigned int bytes_sent; | ||
98 | |||
99 | /** | ||
100 | * Number of messages received from this partner | ||
101 | */ | ||
102 | unsigned int messages_received; | ||
103 | |||
104 | /** | ||
105 | * Number of bytes received from this partner | ||
106 | */ | ||
107 | unsigned int bytes_received; | ||
108 | |||
109 | /* Current ATS properties */ | ||
110 | |||
111 | uint32_t ats_distance; | ||
112 | |||
113 | uint32_t ats_delay; | ||
114 | |||
115 | uint32_t bandwidth_in; | ||
116 | |||
117 | uint32_t bandwidth_out; | ||
118 | |||
119 | uint32_t ats_utilization_up; | ||
120 | |||
121 | uint32_t ats_utilization_down; | ||
122 | |||
123 | uint32_t ats_network_type; | ||
124 | |||
125 | uint32_t ats_cost_wan; | ||
126 | |||
127 | uint32_t ats_cost_lan; | ||
128 | |||
129 | uint32_t ats_cost_wlan; | ||
130 | }; | ||
131 | |||
132 | |||
133 | /** | ||
134 | * Information we track for a peer in the testbed. | ||
135 | */ | ||
136 | struct BenchmarkPeer | ||
137 | { | ||
138 | /** | ||
139 | * Handle with testbed. | ||
140 | */ | ||
141 | struct GNUNET_TESTBED_Peer *peer; | ||
142 | |||
143 | /** | ||
144 | * Unique identifier | ||
145 | */ | ||
146 | int no; | ||
147 | |||
148 | /** | ||
149 | * Is this peer a measter: GNUNET_YES/GNUNET_NO | ||
150 | */ | ||
151 | int master; | ||
152 | |||
153 | /** | ||
154 | * Peer ID | ||
155 | */ | ||
156 | struct GNUNET_PeerIdentity id; | ||
157 | |||
158 | /** | ||
159 | * Testbed operation to get peer information | ||
160 | */ | ||
161 | struct GNUNET_TESTBED_Operation *peer_id_op; | ||
162 | |||
163 | /** | ||
164 | * Testbed operation to connect to ATS performance service | ||
165 | */ | ||
166 | struct GNUNET_TESTBED_Operation *ats_perf_op; | ||
167 | |||
168 | /** | ||
169 | * Testbed operation to connect to core | ||
170 | */ | ||
171 | struct GNUNET_TESTBED_Operation *comm_op; | ||
172 | |||
173 | /** | ||
174 | * ATS performance handle | ||
175 | */ | ||
176 | struct GNUNET_ATS_PerformanceHandle *ats_perf_handle; | ||
177 | |||
178 | /** | ||
179 | * Masters only: | ||
180 | * Testbed connect operations to connect masters to slaves | ||
181 | */ | ||
182 | struct TestbedConnectOperation *core_connect_ops; | ||
183 | |||
184 | /** | ||
185 | * Core handle | ||
186 | */ | ||
187 | struct GNUNET_CORE_Handle *ch; | ||
188 | |||
189 | /** | ||
190 | * Core handle | ||
191 | */ | ||
192 | struct GNUNET_TRANSPORT_Handle *th; | ||
193 | |||
194 | /** | ||
195 | * Masters only: | ||
196 | * Peer to set ATS preferences for | ||
197 | */ | ||
198 | struct BenchmarkPeer *pref_partner; | ||
199 | |||
200 | /** | ||
201 | * Masters only | ||
202 | * Progress task | ||
203 | */ | ||
204 | struct GNUNET_SCHEDULER_Task *ats_task; | ||
205 | |||
206 | /** | ||
207 | * Masters only | ||
208 | * Progress task | ||
209 | */ | ||
210 | double pref_value; | ||
211 | |||
212 | /** | ||
213 | * Array of partners with num_slaves entries (if master) or | ||
214 | * num_master entries (if slave) | ||
215 | */ | ||
216 | struct BenchmarkPartner *partners; | ||
217 | |||
218 | /** | ||
219 | * Number of partners | ||
220 | */ | ||
221 | int num_partners; | ||
222 | |||
223 | /** | ||
224 | * Number of core connections | ||
225 | */ | ||
226 | int core_connections; | ||
227 | |||
228 | /** | ||
229 | * Masters only: | ||
230 | * Number of connections to slave peers | ||
231 | */ | ||
232 | int core_slave_connections; | ||
233 | |||
234 | /** | ||
235 | * Total number of messages this peer has sent | ||
236 | */ | ||
237 | unsigned int total_messages_sent; | ||
238 | |||
239 | /** | ||
240 | * Total number of bytes this peer has sent | ||
241 | */ | ||
242 | unsigned int total_bytes_sent; | ||
243 | |||
244 | /** | ||
245 | * Total number of messages this peer has received | ||
246 | */ | ||
247 | unsigned int total_messages_received; | ||
248 | |||
249 | /** | ||
250 | * Total number of bytes this peer has received | ||
251 | */ | ||
252 | unsigned int total_bytes_received; | ||
253 | }; | ||
254 | |||
255 | |||
256 | /* end of file perf_ats.h */ | ||