Explain is a new parameter
This commit is contained in:
parent
d6254351f6
commit
7e7db6d6df
1 changed files with 13 additions and 7 deletions
|
@ -51,6 +51,7 @@ struct light_ctx {
|
|||
size_t monit_pkt_size;
|
||||
uint8_t csv;
|
||||
uint8_t is_measlat;
|
||||
uint8_t explain;
|
||||
};
|
||||
|
||||
void algo_lightning_free(void* v) {
|
||||
|
@ -73,6 +74,7 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str
|
|||
lightc->fast_count = lightc->total_links / 2;
|
||||
lightc->sleep_duration = 500;
|
||||
lightc->csv = 0;
|
||||
lightc->explain = 0;
|
||||
|
||||
uint64_t window = 2000;
|
||||
if (ap->algo_specific_params != NULL) {
|
||||
|
@ -86,7 +88,8 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str
|
|||
sscanf(token, "window=%ld", &window);
|
||||
sscanf(token, "sent_past_links=%d", &lightc->sent_past_links);
|
||||
sscanf(token, "csv=%d", &lightc->csv);
|
||||
sscanf(token, "measlat=%c", &lightc->is_measlat);
|
||||
sscanf(token, "measlat=%d", &lightc->is_measlat);
|
||||
sscanf(token, "explain=%d", &lightc->explain);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,6 +110,7 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str
|
|||
printf("sent_past_links = %d\n", lightc->sent_past_links);
|
||||
printf("csv = %s\n", lightc->csv ? "yes" : "no");
|
||||
printf("measlat = %s\n", lightc->is_measlat ? "yes" : "no");
|
||||
printf("explain = %s\n", lightc->explain ? "yes" : "no");
|
||||
}
|
||||
|
||||
void monitoring(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buffer_packet* bp) {
|
||||
|
@ -123,11 +127,13 @@ void monitoring(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct
|
|||
uint8_t *prev_links = &ap->fmt.content.link_monitoring_lightning.dyn_struct;
|
||||
int16_t *remote_stats = (int16_t*)(prev_links + sizeof(uint8_t) * lightc->sent_past_links);
|
||||
|
||||
printf("(monitoring.stats) ");
|
||||
for (int i = 0; i < lightc->total_links; i++) {
|
||||
printf("%d, ", remote_stats[i]);
|
||||
if (lightc->explain) {
|
||||
printf("(monitoring.stats) ");
|
||||
for (int i = 0; i < lightc->total_links; i++) {
|
||||
printf("%d, ", remote_stats[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
int64_t pkt_id = ap->fmt.content.link_monitoring_lightning.id;
|
||||
int64_t missing = pkt_id - (lightc->pkt_rcv_id + 1);
|
||||
|
@ -150,7 +156,7 @@ void monitoring(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct
|
|||
te->detected_at = now;
|
||||
te->link_id = link_id;
|
||||
te->pkt_id = miss_id;
|
||||
printf("(monitoring.delay) packet=%ld, link=%d, state=%s\n", miss_id, link_id, ooo_state_str[te->state]);
|
||||
if (lightc->explain) printf("(monitoring.delay) packet=%ld, link=%d, state=%s\n", miss_id, link_id, ooo_state_str[te->state]);
|
||||
}
|
||||
|
||||
// Update current packet status
|
||||
|
@ -160,7 +166,7 @@ void monitoring(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct
|
|||
te2->pkt_id = pkt_id;
|
||||
te2->link_id = link_id;
|
||||
te2->finished_at = now;
|
||||
printf("(monitoring.rcv) packet=%ld, link=%d, state=%s\n", pkt_id, link_id, ooo_state_str[te2->state]);
|
||||
if (lightc->explain) printf("(monitoring.rcv) packet=%ld, link=%d, state=%s\n", pkt_id, link_id, ooo_state_str[te2->state]);
|
||||
}
|
||||
|
||||
int deliver(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct buffer_packet* bp) {
|
||||
|
|
Loading…
Reference in a new issue