aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-ats-solver-eval.h
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-02-07 18:13:06 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-02-07 18:13:06 +0000
commit2db5c20edc405bcaa25214be3d92cb5d1913974b (patch)
tree5cfa39d19a4fc3f4b218f543ec91726335125398 /src/ats/gnunet-ats-solver-eval.h
parentfadd7e8fcaf35436022bf5eafa35a0a5adb9776b (diff)
downloadgnunet-2db5c20edc405bcaa25214be3d92cb5d1913974b.tar.gz
gnunet-2db5c20edc405bcaa25214be3d92cb5d1913974b.zip
preference generation implemented
Diffstat (limited to 'src/ats/gnunet-ats-solver-eval.h')
-rw-r--r--src/ats/gnunet-ats-solver-eval.h244
1 files changed, 14 insertions, 230 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.h b/src/ats/gnunet-ats-solver-eval.h
index 9ea91cb3b..a14f1ea7f 100644
--- a/src/ats/gnunet-ats-solver-eval.h
+++ b/src/ats/gnunet-ats-solver-eval.h
@@ -121,245 +121,29 @@ struct Experiment
121 GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb; 121 GNUNET_ATS_TESTING_ExperimentDoneCallback e_done_cb;
122}; 122};
123 123
124 124struct PreferenceGenerator
125/**
126 * A single logging time step for a partner
127 */
128struct PartnerLoggingTimestep
129{
130 /**
131 * Peer
132 */
133 struct BenchmarkPeer *slave;
134
135 /**
136 * Total number of messages this peer has sent
137 */
138 unsigned int total_messages_sent;
139
140 /**
141 * Total number of bytes this peer has sent
142 */
143 unsigned int total_bytes_sent;
144
145 /**
146 * Total number of messages this peer has received
147 */
148 unsigned int total_messages_received;
149
150 /**
151 * Total number of bytes this peer has received
152 */
153 unsigned int total_bytes_received;
154
155 /**
156 * Total outbound throughput for master in Bytes / s
157 */
158 unsigned int throughput_sent;
159
160 /**
161 * Total inbound throughput for master in Bytes / s
162 */
163 unsigned int throughput_recv;
164
165 /**
166 * Accumulated RTT for all messages
167 */
168 unsigned int total_app_rtt;
169
170 /**
171 * Current application level delay
172 */
173 unsigned int app_rtt;
174
175 /* Current ATS properties */
176
177 uint32_t ats_distance;
178
179 uint32_t ats_delay;
180
181 uint32_t bandwidth_in;
182
183 uint32_t bandwidth_out;
184
185 uint32_t ats_utilization_up;
186
187 uint32_t ats_utilization_down;
188
189 uint32_t ats_network_type;
190
191 uint32_t ats_cost_wan;
192
193 uint32_t ats_cost_lan;
194
195 uint32_t ats_cost_wlan;
196
197 double pref_bandwidth;
198 double pref_delay;
199};
200
201
202/**
203 * A single logging time step for a peer
204 */
205struct PeerLoggingTimestep
206{
207 /**
208 * Next in DLL
209 */
210 struct PeerLoggingTimestep *next;
211
212 /**
213 * Prev in DLL
214 */
215 struct PeerLoggingTimestep *prev;
216
217 /**
218 * Logging timestamp
219 */
220 struct GNUNET_TIME_Absolute timestamp;
221
222 /**
223 * Total number of messages this peer has sent
224 */
225 unsigned int total_messages_sent;
226
227 /**
228 * Total number of bytes this peer has sent
229 */
230 unsigned int total_bytes_sent;
231
232 /**
233 * Total number of messages this peer has received
234 */
235 unsigned int total_messages_received;
236
237 /**
238 * Total number of bytes this peer has received
239 */
240 unsigned int total_bytes_received;
241
242 /**
243 * Total outbound throughput for master in Bytes / s
244 */
245 unsigned int total_throughput_send;
246
247 /**
248 * Total inbound throughput for master in Bytes / s
249 */
250 unsigned int total_throughput_recv;
251
252 /**
253 * Logs for slaves
254 */
255 struct PartnerLoggingTimestep *slaves_log;
256};
257
258/**
259 * Entry for a benchmark peer
260 */
261struct LoggingPeer
262{ 125{
263 /** 126 struct PreferenceGenerator *prev;
264 * Peer 127 struct PreferenceGenerator *next;
265 */
266 struct BenchmarkPeer *peer;
267
268 /**
269 * Start time
270 */
271 struct GNUNET_TIME_Absolute start;
272
273 /**
274 * DLL for logging entries: head
275 */
276 struct PeerLoggingTimestep *head;
277 128
278 /** 129 enum GeneratorType type;
279 * DLL for logging entries: tail
280 */
281 struct PeerLoggingTimestep *tail;
282};
283 130
131 unsigned int peer;
132 unsigned int address_id;
284 133
285struct LoggingHandle 134 enum GNUNET_ATS_PreferenceKind kind;
286{
287 /**
288 * Logging task
289 */
290 GNUNET_SCHEDULER_TaskIdentifier log_task;
291 135
292 /** 136 long int base_value;
293 * Reference to perf_ats' masters 137 long int max_value;
294 */ 138 struct GNUNET_TIME_Relative duration_period;
295 int num_masters;
296 int num_slaves;
297 int running;
298 int verbose;
299 char *name;
300 struct GNUNET_TIME_Relative frequency; 139 struct GNUNET_TIME_Relative frequency;
301 140
302 /** 141 GNUNET_SCHEDULER_TaskIdentifier set_task;
303 * Log structure of length num_peers 142 struct GNUNET_TIME_Absolute next_ping_transmission;
304 */ 143 struct GNUNET_TIME_Absolute time_start;
305 struct LoggingPeer *lp;
306}; 144};
307 145
308 146
309/**
310 * Start logging
311 *
312 * @param log_frequency the logging frequency
313 * @param testname the testname
314 * @param masters the master peers used for benchmarking
315 * @param num_master the number of master peers
316 * @return the logging handle or NULL on error
317 */
318struct LoggingHandle *
319GNUNET_ATS_TEST_logging_start(struct GNUNET_TIME_Relative log_frequency,
320 char *testname, struct BenchmarkPeer *masters, int num_masters, int num_slaves,
321 int verbose);
322
323/**
324 * Stop logging
325 *
326 * @param l the logging handle
327 */
328void
329GNUNET_ATS_TEST_logging_clean_up (struct LoggingHandle *l);
330
331/**
332 * Stop logging
333 *
334 * @param l the logging handle
335 */
336void
337GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l);
338
339/**
340 * Log all data now
341 *
342 * @param l logging handle to use
343 */
344void
345GNUNET_ATS_TEST_logging_now (struct LoggingHandle *l);
346
347
348/**
349 * Write logging data to file
350 *
351 * @param l logging handle to use
352 * @param test_name name of the current test
353 * @param plots create gnuplots: GNUNET_YES or GNUNET_NO
354 */
355void
356GNUNET_ATS_TEST_logging_write_to_file (struct LoggingHandle *l,
357 char *test_name, int plots);
358
359
360
361
362
363 147
364/* LEGACY */ 148/* LEGACY */
365 149
@@ -417,7 +201,7 @@ typedef void (*GNUNET_ATS_TEST_TopologySetupDoneCallback) (void *cls,
417 */ 201 */
418typedef void 202typedef void
419(*GNUNET_ATS_TEST_LogRequest) (void *cls, 203(*GNUNET_ATS_TEST_LogRequest) (void *cls,
420 const struct GNUNET_HELLO_Address *address, 204 const struct GNUNET_HELLO_Address *address_id,
421 int address_active, 205 int address_active,
422 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 206 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
423 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 207 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,