Stay on an average basis

This commit is contained in:
Quentin 2019-10-22 11:26:13 +02:00
parent 84161c91bb
commit 14452d4c4e
2 changed files with 11 additions and 7 deletions

View file

@ -10,7 +10,7 @@ ggplot(data=link_info, aes(x=timestamp, y=link, color=speed)) +
theme_classic()
xx <- read.csv("../../donar-res/tmp_light/ac.csv")
xx <- read.csv("../../donar-res/tmp_light/ae.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() +
@ -92,10 +92,10 @@ ggplot(data=sqldf("select * from xa where run='out/bhTF0rd7MOI5SOPs-6'"), aes(x=
#geom_point(aes(shape=conf)) +
theme_classic()
xb <- read.csv("../../donar-res/tmp_light/ac.csv")
xb <- read.csv("../../donar-res/tmp_light/ae.csv")
xb$flag <- factor(xb$flag)
xb$link_id <- factor(xb$link_id)
xc <- sqldf("select *, 1.0 * latency / 1000.0 as lat from xb where vanilla = 1 and link_id = 5")
xc <- sqldf("select *, 1.0 * latency / 1000.0 as lat from xb where vanilla = 1 and link_id = 0")
ggplot(data=xc, aes(x=packet_id, y=lat, color=link_id:way)) +
coord_cartesian(ylim=c(100,600)) +
geom_line() +
@ -140,3 +140,4 @@ ggplot(data=xd, aes(x=packet_id, y=lat, color=link_id)) +
ggplot(data=sqldf("select * from xb where vanilla = 1 and way= 'server'"), aes(x=packet_id, y=link_id, color=flag)) +
geom_point() +
theme_classic()

View file

@ -355,14 +355,17 @@ void algo_lightning_update_stats (struct light_ctx *lightc) {
// Set my local stats + merge remote stats
for (int i = 0; i < lightc->total_links; i++) {
lightc->local_stats[i] = lightc->stats[i].ooo;
/* AVG */
if (lightc->remote_stats[i] == -1) continue;
if (lightc->stats[i].ooo == -1) lightc->stats[i].ooo = lightc->remote_stats[i];
else lightc->stats[i].ooo = (lightc->remote_stats[i] + lightc->stats[i].ooo) / 2;
/*
if (lightc->remote_stats[i] > stats[i].ooo) {
/* MAX
if (lightc->remote_stats[i] > lightc->stats[i].ooo) {
if (lightc->explain) printf("(stats.remote) link=%d, delta=%d\n", i, lightc->remote_stats[i]);
stats[i].ooo = lightc->remote_stats[i];
}*/
lightc->stats[i].ooo = lightc->remote_stats[i];
} */
}
// Sort