aboutsummaryrefslogtreecommitdiff
path: root/src/ats/perf_ats_solver.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-28 09:18:27 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-28 09:18:27 +0000
commitc0a74f813e2ec60f271e5da6db2980343ab9fedb (patch)
tree9882a9352ce6b058f4b20e9947a3c958963e18da /src/ats/perf_ats_solver.c
parente213ad83a60ca87db9fac2909db409645d39ce83 (diff)
downloadgnunet-c0a74f813e2ec60f271e5da6db2980343ab9fedb.tar.gz
gnunet-c0a74f813e2ec60f271e5da6db2980343ab9fedb.zip
documentation for the performance benchmark
Diffstat (limited to 'src/ats/perf_ats_solver.c')
-rw-r--r--src/ats/perf_ats_solver.c113
1 files changed, 106 insertions, 7 deletions
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index 7440f6ec3..4ad93e0ba 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -191,62 +191,161 @@ struct PerfHandle
191 int expecting_solution; 191 int expecting_solution;
192}; 192};
193 193
194/**
195 * Data structure to store results for a single iteration
196 */
194struct Iteration 197struct Iteration
195{ 198{
199 /**
200 * Head of the linked list
201 */
196 struct Result *result_head; 202 struct Result *result_head;
197 203
204 /**
205 * Tail of the linked list
206 */
198 struct Result *result_tail; 207 struct Result *result_tail;
199}; 208};
200 209
210
211/**
212 * Result for a solver calculcation
213 */
201struct Result 214struct Result
202{ 215{
216 /**
217 * Previous element in the linked list
218 */
203 struct Result *prev; 219 struct Result *prev;
220
221 /**
222 * Next element in the linked list
223 */
204 struct Result *next; 224 struct Result *next;
205 225
226 /**
227 * Number of peers this solution included
228 */
206 int peers; 229 int peers;
230
231 /**
232 * Number of addresses per peer this solution included
233 */
207 int addresses; 234 int addresses;
235
236 /**
237 * Is this an update or a full solution
238 */
208 int update; 239 int update;
240
241 /**
242 * Was the solution valid or did the solver fail
243 */
209 int valid; 244 int valid;
210 245
246 /**
247 * Result of the solver
248 */
211 enum GAS_Solver_Additional_Information info; 249 enum GAS_Solver_Additional_Information info;
212 250
251 /**
252 * Duration of setting up the problem in the solver
253 */
213 struct GNUNET_TIME_Relative d_setup; 254 struct GNUNET_TIME_Relative d_setup;
255
256 /**
257 * Duration of solving the LP problem in the solver
258 * MLP solver only
259 */
214 struct GNUNET_TIME_Relative d_lp; 260 struct GNUNET_TIME_Relative d_lp;
261
262 /**
263 * Duration of solving the MLP problem in the solver
264 * MLP solver only
265 */
215 struct GNUNET_TIME_Relative d_mlp; 266 struct GNUNET_TIME_Relative d_mlp;
267
268 /**
269 * Duration of solving whole problem in the solver
270 */
216 struct GNUNET_TIME_Relative d_total; 271 struct GNUNET_TIME_Relative d_total;
217 272
273 /**
274 * Start time of setting up the problem in the solver
275 */
218 struct GNUNET_TIME_Absolute s_setup; 276 struct GNUNET_TIME_Absolute s_setup;
277
278 /**
279 * Start time of solving the LP problem in the solver
280 * MLP solver only
281 */
219 struct GNUNET_TIME_Absolute s_lp; 282 struct GNUNET_TIME_Absolute s_lp;
283
284 /**
285 * Start time of solving the MLP problem in the solver
286 * MLP solver only
287 */
220 struct GNUNET_TIME_Absolute s_mlp; 288 struct GNUNET_TIME_Absolute s_mlp;
289
290 /**
291 * Start time of solving whole problem in the solver
292 */
221 struct GNUNET_TIME_Absolute s_total; 293 struct GNUNET_TIME_Absolute s_total;
222 294
295 /**
296 * End time of setting up the problem in the solver
297 */
223 struct GNUNET_TIME_Absolute e_setup; 298 struct GNUNET_TIME_Absolute e_setup;
299
300 /**
301 * End time of solving the LP problem in the solver
302 * MLP solver only
303 */
224 struct GNUNET_TIME_Absolute e_lp; 304 struct GNUNET_TIME_Absolute e_lp;
305
306 /**
307 * End time of solving the MLP problem in the solver
308 * MLP solver only
309 */
225 struct GNUNET_TIME_Absolute e_mlp; 310 struct GNUNET_TIME_Absolute e_mlp;
311
312 /**
313 * End time of solving whole problem in the solver
314 */
226 struct GNUNET_TIME_Absolute e_total; 315 struct GNUNET_TIME_Absolute e_total;
227}; 316};
228 317
318/**
319 * Peer used for the benchmarking
320 */
229struct PerfPeer 321struct PerfPeer
230{ 322{
323 /**
324 * Peer identitity
325 */
231 struct GNUNET_PeerIdentity id; 326 struct GNUNET_PeerIdentity id;
232 327
328 /**
329 * Head of linked list of addresses used with this peer
330 */
233 struct ATS_Address *head; 331 struct ATS_Address *head;
332
333 /**
334 * Head of linked list of addresses used with this peer
335 */
234 struct ATS_Address *tail; 336 struct ATS_Address *tail;
235}; 337};
236 338
237static struct PerfHandle ph;
238 339
239/** 340/**
240 * Return value 341 * ATS performance handle
241 */ 342 */
242static int ret; 343static struct PerfHandle ph;
243
244 344
245/** 345/**
246 * ATS information 346 * Return value
247 */ 347 */
248//static struct GNUNET_ATS_Information ats[2]; 348static int ret;
249
250 349
251static void 350static void
252end_now (int res) 351end_now (int res)