diff --git a/r/config_light.R b/r/config_light.R index 2989d17..6db7281 100644 --- a/r/config_light.R +++ b/r/config_light.R @@ -2,28 +2,55 @@ library(ggplot2) library(sqldf) library(plyr) library(dplyr) +library(cowplot) -d <- read.csv("../../donar-res/tmp_light/boxplot1.csv") +d <- read.csv("../../donar-res/tmp_light/boxplot4.csv") d$strat <- as.factor(d$strat) d$window <- as.factor(d$window) #d$decile <- factor(d$decile, levels = c("MIN", "D0.1", "D1", "D25", "D50", "D75", "D99", "D99.9")) d$decile <-factor(d$decile,levels=c("MAX", "D99.9", "D99", "D75", "D50", "D25", "D1", "D0.1", "MIN")) +d$strat <- revalue(d$strat, c("1"="T", "0"="D")) d <- d %>% mutate (lat = latency / 1000) -ggplot(sqldf("select * from d where decile != 'MAX'") %>% arrange(decile), aes(x=strat:window,y=lat,group=decile,fill=decile)) + +gd <- ggplot(sqldf("select * from d where decile != 'MAX'") %>% arrange(decile), aes(x=strat:window,y=lat,group=decile,fill=decile)) + geom_bar(stat='identity', position='identity') + scale_fill_grey() + + ylab("Latency (ms)") + + xlab("Strategy:Window") + + coord_cartesian(ylim=c(0,600)) + geom_hline(yintercept = 200) + geom_hline(yintercept = 400) + theme_classic() -e <- read.csv("../../donar-res/tmp_light/boxplot2.csv") +e <- read.csv("../../donar-res/tmp_light/boxplot5.csv") e$strat <- as.factor(e$strat) e$links <- as.factor(e$links) +e$strat <- revalue(e$strat, c("1"="T", "0"="D")) e$decile <-factor(e$decile,levels=c("MAX", "D99.9", "D99", "D75", "D50", "D25", "D1", "D0.1", "MIN")) e <- e %>% mutate (lat = latency / 1000) -ggplot(sqldf("select * from e where decile != 'MAX'") %>% arrange(decile), aes(x=strat:links,y=lat,group=decile,fill=decile)) + +ge <- ggplot(sqldf("select * from e where decile != 'MAX'") %>% arrange(decile), aes(x=strat:links,y=lat,group=decile,fill=decile)) + + geom_bar(stat='identity', position='identity') + + scale_fill_grey() + + ylab("Latency (ms)") + + xlab("Strategy:Links") + + geom_hline(yintercept = 200) + + geom_hline(yintercept = 400) + + coord_cartesian(ylim=c(0,600)) + + theme_classic() + +f <- read.csv("../../donar-res/tmp_light/boxplot3.csv") +f$strat <- as.factor(f$strat) +f$strat <- revalue(f$strat, c("1"="T", "0"="D")) +f$fast_count <- as.factor(f$fast_count) +f$decile <-factor(f$decile,levels=c("MAX", "D99.9", "D99", "D75", "D50", "D25", "D1", "D0.1", "MIN")) +f <- f %>% mutate (lat = latency / 1000) +gf <- ggplot(sqldf("select * from f where decile != 'MAX'") %>% arrange(decile), aes(x=strat:fast_count,y=lat,group=decile,fill=decile)) + geom_bar(stat='identity', position='identity') + scale_fill_grey() + geom_hline(yintercept = 200) + geom_hline(yintercept = 400) + + coord_cartesian(ylim=c(0,600)) + + ylab("Latency (ms)") + + xlab("Strategy:Fast Links") + theme_classic() + +plot_grid(gd, ge, gf, ncol=1) + ggsave("light_config.png", dpi=300, dev='png', height=20, width=20, units="cm") diff --git a/src/algo_lightning.c b/src/algo_lightning.c index 7847422..657b7b6 100644 --- a/src/algo_lightning.c +++ b/src/algo_lightning.c @@ -6,7 +6,7 @@ #include "timer.h" #include "proxy.h" #include "measure.h" -#define HISTORIC_SIZE 256 +#define HISTORIC_SIZE 2048 #define MAX_LINKS 64 enum ooo_state {