diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
commit | 3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch) | |
tree | 61ce41a52cd6e7232cead77818ef265993b2427e /src/experimentation | |
parent | 4a0398474db197abed243a123fb971fbeeffab4b (diff) | |
download | gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.tar.gz gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.zip |
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/experimentation')
-rw-r--r-- | src/experimentation/gnunet-daemon-experimentation_experiments.c | 12 | ||||
-rw-r--r-- | src/experimentation/gnunet-daemon-experimentation_scheduler.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/experimentation/gnunet-daemon-experimentation_experiments.c b/src/experimentation/gnunet-daemon-experimentation_experiments.c index 99348a2cb..891865b39 100644 --- a/src/experimentation/gnunet-daemon-experimentation_experiments.c +++ b/src/experimentation/gnunet-daemon-experimentation_experiments.c | |||
@@ -158,7 +158,7 @@ find_it (void *cls, | |||
158 | 158 | ||
159 | if (0 != strcmp(e->name, find_ctx->name)) | 159 | if (0 != strcmp(e->name, find_ctx->name)) |
160 | return GNUNET_OK; | 160 | return GNUNET_OK; |
161 | if (e->version.abs_value != find_ctx->version.abs_value) | 161 | if (e->version.abs_value_us != find_ctx->version.abs_value_us) |
162 | return GNUNET_OK; | 162 | return GNUNET_OK; |
163 | 163 | ||
164 | find_ctx->res = e; | 164 | find_ctx->res = e; |
@@ -272,8 +272,8 @@ int GNUNET_EXPERIMENTATION_experiments_add (struct Issuer *i, | |||
272 | e->name, | 272 | e->name, |
273 | GNUNET_STRINGS_absolute_time_to_string (start), | 273 | GNUNET_STRINGS_absolute_time_to_string (start), |
274 | GNUNET_STRINGS_absolute_time_to_string (stop), | 274 | GNUNET_STRINGS_absolute_time_to_string (stop), |
275 | (long long unsigned int) frequency.rel_value / 1000, | 275 | (long long unsigned int) frequency.rel_value_us / 1000000LL, |
276 | (long long unsigned int) duration.rel_value / 1000); | 276 | (long long unsigned int) duration.rel_value_us / 1000000LL); |
277 | GNUNET_CONTAINER_multihashmap_put (experiments, &e->issuer.hashPubKey, e, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 277 | GNUNET_CONTAINER_multihashmap_put (experiments, &e->issuer.hashPubKey, e, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
278 | GNUNET_STATISTICS_set (GED_stats, "# experiments", GNUNET_CONTAINER_multihashmap_size (experiments), GNUNET_NO); | 278 | GNUNET_STATISTICS_set (GED_stats, "# experiments", GNUNET_CONTAINER_multihashmap_size (experiments), GNUNET_NO); |
279 | 279 | ||
@@ -336,7 +336,7 @@ void exp_file_iterator (void *cls, | |||
336 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Experiment `%s': Version missing or invalid \n"), name); | 336 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Experiment `%s': Version missing or invalid \n"), name); |
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | version.abs_value = number; | 339 | version.abs_value_us = number; // FIXME: what is this supposed to be? Version != TIME!??? |
340 | 340 | ||
341 | /* Required capabilities */ | 341 | /* Required capabilities */ |
342 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (exp, name, "CAPABILITIES", &number)) | 342 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (exp, name, "CAPABILITIES", &number)) |
@@ -358,14 +358,14 @@ void exp_file_iterator (void *cls, | |||
358 | 358 | ||
359 | 359 | ||
360 | 360 | ||
361 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (exp, name, "START", (long long unsigned int *) &start.abs_value)) | 361 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (exp, name, "START", (long long unsigned int *) &start.abs_value_us)) |
362 | start = GNUNET_TIME_UNIT_ZERO_ABS; | 362 | start = GNUNET_TIME_UNIT_ZERO_ABS; |
363 | 363 | ||
364 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time (exp, name, "FREQUENCY", &frequency)) | 364 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time (exp, name, "FREQUENCY", &frequency)) |
365 | frequency = EXP_DEFAULT_EXP_FREQ; | 365 | frequency = EXP_DEFAULT_EXP_FREQ; |
366 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time (exp, name, "DURATION", &duration)) | 366 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_time (exp, name, "DURATION", &duration)) |
367 | duration = EXP_DEFAULT_EXP_DUR; | 367 | duration = EXP_DEFAULT_EXP_DUR; |
368 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (exp, name, "STOP", (long long unsigned int *)&stop.abs_value)) | 368 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_number (exp, name, "STOP", (long long unsigned int *)&stop.abs_value_us)) |
369 | stop = GNUNET_TIME_UNIT_FOREVER_ABS; | 369 | stop = GNUNET_TIME_UNIT_FOREVER_ABS; |
370 | 370 | ||
371 | GNUNET_EXPERIMENTATION_experiments_add (i, name, issuer, version, | 371 | GNUNET_EXPERIMENTATION_experiments_add (i, name, issuer, version, |
diff --git a/src/experimentation/gnunet-daemon-experimentation_scheduler.c b/src/experimentation/gnunet-daemon-experimentation_scheduler.c index 784baa4d4..34142fabb 100644 --- a/src/experimentation/gnunet-daemon-experimentation_scheduler.c +++ b/src/experimentation/gnunet-daemon-experimentation_scheduler.c | |||
@@ -133,7 +133,7 @@ static void run_experiment_inbound (void *cls,const struct GNUNET_SCHEDULER_Task | |||
133 | se->state = REQUESTED; | 133 | se->state = REQUESTED; |
134 | /* Schedule to run */ | 134 | /* Schedule to run */ |
135 | start = GNUNET_TIME_absolute_get_remaining(se->e->start); | 135 | start = GNUNET_TIME_absolute_get_remaining(se->e->start); |
136 | if (0 == start.rel_value) | 136 | if (0 == start.rel_value_us) |
137 | se->task = GNUNET_SCHEDULER_add_now (&run_experiment_inbound, se); | 137 | se->task = GNUNET_SCHEDULER_add_now (&run_experiment_inbound, se); |
138 | else | 138 | else |
139 | se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_inbound, se); | 139 | se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_inbound, se); |
@@ -155,7 +155,7 @@ static void run_experiment_inbound (void *cls,const struct GNUNET_SCHEDULER_Task | |||
155 | 155 | ||
156 | /* Reschedule */ | 156 | /* Reschedule */ |
157 | end = GNUNET_TIME_absolute_get_remaining(GNUNET_TIME_absolute_add (se->e->stop, se->e->frequency)); | 157 | end = GNUNET_TIME_absolute_get_remaining(GNUNET_TIME_absolute_add (se->e->stop, se->e->frequency)); |
158 | if (0 == end.rel_value) | 158 | if (0 == end.rel_value_us) |
159 | { | 159 | { |
160 | se->state = STOPPED; | 160 | se->state = STOPPED; |
161 | return; /* End of experiment is reached */ | 161 | return; /* End of experiment is reached */ |
@@ -201,7 +201,7 @@ static void run_experiment_outbound (void *cls,const struct GNUNET_SCHEDULER_Tas | |||
201 | 201 | ||
202 | /* Reschedule */ | 202 | /* Reschedule */ |
203 | end = GNUNET_TIME_absolute_get_remaining(GNUNET_TIME_absolute_add (se->e->stop, se->e->frequency)); | 203 | end = GNUNET_TIME_absolute_get_remaining(GNUNET_TIME_absolute_add (se->e->stop, se->e->frequency)); |
204 | if (0 == end.rel_value) | 204 | if (0 == end.rel_value_us) |
205 | { | 205 | { |
206 | se->state = STOPPED; | 206 | se->state = STOPPED; |
207 | return; /* End of experiment is reached */ | 207 | return; /* End of experiment is reached */ |
@@ -328,7 +328,7 @@ GED_scheduler_add (struct Node *n, struct Experiment *e, int outbound) | |||
328 | 328 | ||
329 | start = GNUNET_TIME_absolute_get_remaining(e->start); | 329 | start = GNUNET_TIME_absolute_get_remaining(e->start); |
330 | end = GNUNET_TIME_absolute_get_remaining(e->stop); | 330 | end = GNUNET_TIME_absolute_get_remaining(e->stop); |
331 | if (0 == end.rel_value) | 331 | if (0 == end.rel_value_us) |
332 | return; /* End of experiment is reached */ | 332 | return; /* End of experiment is reached */ |
333 | 333 | ||
334 | /* Add additional checks here if required */ | 334 | /* Add additional checks here if required */ |
@@ -340,7 +340,7 @@ GED_scheduler_add (struct Node *n, struct Experiment *e, int outbound) | |||
340 | 340 | ||
341 | if (GNUNET_YES == outbound) | 341 | if (GNUNET_YES == outbound) |
342 | { | 342 | { |
343 | if (0 == start.rel_value) | 343 | if (0 == start.rel_value_us) |
344 | se->task = GNUNET_SCHEDULER_add_now (&run_experiment_outbound, se); | 344 | se->task = GNUNET_SCHEDULER_add_now (&run_experiment_outbound, se); |
345 | else | 345 | else |
346 | se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_outbound, se); | 346 | se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_outbound, se); |
@@ -348,7 +348,7 @@ GED_scheduler_add (struct Node *n, struct Experiment *e, int outbound) | |||
348 | } | 348 | } |
349 | else | 349 | else |
350 | { | 350 | { |
351 | if (0 == start.rel_value) | 351 | if (0 == start.rel_value_us) |
352 | se->task = GNUNET_SCHEDULER_add_now (&run_experiment_inbound, se); | 352 | se->task = GNUNET_SCHEDULER_add_now (&run_experiment_inbound, se); |
353 | else | 353 | else |
354 | se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_inbound, se); | 354 | se->task = GNUNET_SCHEDULER_add_delayed (start, &run_experiment_inbound, se); |