diff --git a/src/algo_lightning.c b/src/algo_lightning.c index ea9fedc..898af49 100644 --- a/src/algo_lightning.c +++ b/src/algo_lightning.c @@ -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);