Switch to milliseconds

This commit is contained in:
Quentin 2019-10-08 10:22:14 +02:00
parent 927123cb2e
commit 721f4ea54f

View file

@ -73,7 +73,7 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str
union abstract_packet m;
lightc->monit_pkt_size = sizeof(m.fmt.headers) + sizeof(m.fmt.content.link_monitoring_lightning) + sizeof(uint8_t) * (lightc->sent_past_links - 1);
timespec_set_unit (&lightc->window, window, MICROSEC);
timespec_set_unit (&lightc->window, window, MILISEC);
printf("max_ooo = %d ms\n", lightc->max_ooo);
printf("recovery = %d ms\n", lightc->sleep_duration);
@ -161,11 +161,11 @@ void algo_lightning_update_stats (struct light_ctx *lightc, int64_t *stats) {
break;
case OOO_ONGOING:
timespec_diff(&now, &lightc->historic[i].detected_at, &temp_time);
delta = timespec_get_unit (&temp_time, MICROSEC);
delta = timespec_get_unit (&temp_time, MILISEC);
break;
case OOO_DONE:
timespec_diff(&lightc->historic[i].finished_at, &lightc->historic[i].detected_at, &temp_time);
delta = timespec_get_unit (&temp_time, MICROSEC);
delta = timespec_get_unit (&temp_time, MILISEC);
break;
}
uint8_t l = lightc->historic[i].link_id;
@ -224,6 +224,12 @@ int algo_lightning_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo*
int64_t stats[MAX_LINKS];
algo_lightning_update_stats(lightc, stats);
printf("retained stat: ");
for (int i = 0; i < lightc->total_links; i++) {
printf("%ld, ", stats[i]);
}
printf("\n");
struct timespec now, temp_time;
set_now(&now);