explain switch

This commit is contained in:
Quentin 2019-10-15 14:22:45 +02:00
parent 7e7db6d6df
commit c20117188c
3 changed files with 28 additions and 12 deletions

View file

@ -10,7 +10,7 @@ ggplot(data=link_info, aes(x=timestamp, y=link, color=speed)) +
theme_classic()
xx <- read.csv("../res/tmp_graph/r.csv")
xx <- read.csv("../res/tmp_light/a.csv")
xx2 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx group by packet_id,way")
ggplot(data=xx2, aes(x=packet_id, y=lat, color=way)) +
geom_line() +
@ -21,7 +21,7 @@ ggplot(data=xx2, aes(x=packet_id, y=lat, color=way)) +
xx4 <- sqldf("select packet_id,1.0 * latency / 1000.0 as lat,way from xx where flag = 0")
ggplot(data=xx4, aes(x=packet_id, y=lat, color=way)) +
geom_line() +
coord_cartesian(ylim=c(0,2000)) +
coord_cartesian(ylim=c(0,1000)) +
#geom_point() +
theme_classic()
@ -29,7 +29,7 @@ ggplot(data=xx4, aes(x=packet_id, y=lat, color=way)) +
xx5 <- sqldf("select packet_id,1.0 * latency / 1000.0 as lat,way from xx where flag = 1")
ggplot(data=xx5, aes(x=packet_id, y=lat, color=way)) +
geom_line() +
coord_cartesian(ylim=c(0,2000)) +
coord_cartesian(ylim=c(0,1000)) +
#geom_point() +
theme_classic()
@ -57,5 +57,5 @@ xx3 <- sqldf("select packet_id,1.0 * latency / 1000.0 as lat,flag,way from xx")
xx3$flag <- factor(xx3$flag)
ggplot(data=xx3, aes(x=lat, group=flag, color=flag)) +
stat_ecdf(pad = FALSE) +
#coord_cartesian(xlim=c(0,2000)) +
coord_cartesian(xlim=c(0,1200)) +
theme_classic()

View file

@ -7,8 +7,9 @@ tor_owd <- read.csv("tor_owd.csv")
for (run_id in c(0:39)) {
print(run_id)
sel_owd <- filter(tor_owd, measure_type != "delta", run == paste("./out/nBV7DWLpj8WA6Be3-",run_id,sep=""))
sel_owd <- filter(tor_owd, measure_type != "delta", measure_type != 'd_client_server', measure_type != 'd_server_client', measure_type != 'd_server_client_abs', measure_type != 'd_client_server_abs', run == paste("./out/nBV7DWLpj8WA6Be3-",run_id,sep=""))
ggplot(data = sel_owd, aes(x = packet_id, y=latency_ms, color=measure_type)) +
coord_cartesian(ylim=c(0,600)) +
geom_line() +
theme_classic() +
ggsave(paste("tor_owd_",run_id,".png", sep = ""), dpi=150, dev='png', height=18, width=32, units="cm")
@ -18,3 +19,14 @@ ggplot(data = sqldf("select * from tor_owd where measure_type='delta_abs'"), aes
stat_ecdf(pad = FALSE) +
coord_cartesian(xlim = c(0,500)) +
theme_classic()
ggplot(data = sqldf("select * from tor_owd where measure_type='d_client_server_abs' or measure_type='d_server_client_abs'"), aes(x=latency_ms)) +
stat_ecdf(pad = FALSE) +
coord_cartesian(xlim = c(0,500)) +
theme_classic()
ggplot(data = sqldf("select * from tor_owd where packet_id < 500 and run = './out/nBV7DWLpj8WA6Be3-16' and (measure_type='d_client_server' or measure_type='d_server_client')"), aes(y=latency_ms,x=packet_id,color=measure_type)) +
geom_line() +
coord_cartesian(ylim=c(-250,250)) +
geom_point() +
theme_classic()

View file

@ -232,10 +232,11 @@ void algo_lightning_update_stats (struct light_ctx *lightc, struct stat_entry *s
delta = timespec_get_unit (&temp_time, MILISEC);
break;
}
printf("(stats.compute) packet=%ld, link=%d, status=%s, delta=%ld\n", lightc->historic[i].pkt_id, l, ooo_state_str[lightc->historic[i].state], delta);
if (lightc->explain) printf("(stats.compute) packet=%ld, link=%d, status=%s, delta=%ld\n", lightc->historic[i].pkt_id, l, ooo_state_str[lightc->historic[i].state], delta);
stats[l].link_id = l;
if (delta > stats[l].max_ooo) {
printf("(stats.local) link=%d, delta=%ld\n", l, delta);
if (lightc->explain) printf("(stats.local) link=%d, delta=%ld\n", l, delta);
stats[l].max_ooo = delta;
}
}
@ -244,7 +245,7 @@ void algo_lightning_update_stats (struct light_ctx *lightc, struct stat_entry *s
for (int i = 0; i < lightc->total_links; i++) {
lightc->local_stats[i] = stats[i].max_ooo;
if (lightc->remote_stats[i] > stats[i].max_ooo) {
printf("(stats.remote) link=%d, delta=%d\n", i, lightc->remote_stats[i]);
if (lightc->explain) printf("(stats.remote) link=%d, delta=%d\n", i, lightc->remote_stats[i]);
stats[i].max_ooo = lightc->remote_stats[i];
}
}
@ -287,11 +288,14 @@ int send_message(struct evt_core_ctx* ctx, struct buffer_packet* bp) {
links[i] = lightc->prev_links[(lightc->pkt_sent_id - (i + 1)) % MAX_LINKS];
}
memcpy(remote_stats, &lightc->local_stats, sizeof(int16_t) * lightc->total_links);
printf("(send.stats) ");
for (int i = 0; i < lightc->total_links; i++) {
printf("%d, ", remote_stats[i]);
if (lightc->explain) {
printf("(send.stats) ");
for (int i = 0; i < lightc->total_links; i++) {
printf("%d, ", remote_stats[i]);
}
printf("\n");
}
printf("\n");
lightc->prev_links[lightc->pkt_sent_id % MAX_LINKS] = lightc->selected_link;