Switch to milliseconds
This commit is contained in:
parent
927123cb2e
commit
721f4ea54f
1 changed files with 9 additions and 3 deletions
|
@ -73,7 +73,7 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str
|
||||||
|
|
||||||
union abstract_packet m;
|
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);
|
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("max_ooo = %d ms\n", lightc->max_ooo);
|
||||||
printf("recovery = %d ms\n", lightc->sleep_duration);
|
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;
|
break;
|
||||||
case OOO_ONGOING:
|
case OOO_ONGOING:
|
||||||
timespec_diff(&now, &lightc->historic[i].detected_at, &temp_time);
|
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;
|
break;
|
||||||
case OOO_DONE:
|
case OOO_DONE:
|
||||||
timespec_diff(&lightc->historic[i].finished_at, &lightc->historic[i].detected_at, &temp_time);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
uint8_t l = lightc->historic[i].link_id;
|
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];
|
int64_t stats[MAX_LINKS];
|
||||||
algo_lightning_update_stats(lightc, stats);
|
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;
|
struct timespec now, temp_time;
|
||||||
set_now(&now);
|
set_now(&now);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue