tor_multipath_voip/r/config_light.R

415 lines
20 KiB
R
Raw Normal View History

2019-10-31 17:05:47 +00:00
library(ggplot2)
library(sqldf)
library(plyr)
library(dplyr)
2019-11-01 14:34:23 +00:00
library(cowplot)
2019-10-31 17:05:47 +00:00
2020-01-23 09:48:36 +00:00
scale_fill_bw_qdu_6 <- scale_fill_manual(values = c("#000000", "#333333", "#666666", "#999999", "#cccccc", "#ffffff"))
scale_fill_bw_qdu_4 <- scale_fill_manual(values = c("#000000", "#555555", "#aaaaaa", "#ffffff"))
2019-11-02 16:53:27 +00:00
d <- read.csv("../../donar-res/tmp_light/window3.csv")
d <- d %>% mutate (window = window / 1000)
2019-10-31 17:05:47 +00:00
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"))
2019-11-02 16:53:27 +00:00
d$percentile <-factor(d$percentile,levels=c("MAX", "P99.9", "P99", "P75", "P50", "P25", "P1", "P0.1", "MIN"))
2020-01-23 09:48:36 +00:00
d$strat <- revalue(d$strat, c("1"="TickTock", "0"="Duplicate"))
2019-10-31 17:05:47 +00:00
d <- d %>% mutate (lat = latency / 1000)
2020-01-23 09:48:36 +00:00
dwin <- sqldf("select * from d where percentile != 'MAX' and percentile != 'P1' and percentile != 'P0.1'") %>% arrange(percentile)
gd <- ggplot(dwin, aes(x=window,y=lat,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity', color="black", width=1) +
2019-10-31 17:05:47 +00:00
scale_fill_grey() +
2019-11-01 14:34:23 +00:00
ylab("Latency (ms)") +
2020-01-23 09:48:36 +00:00
xlab("Window (sec)") +
2019-11-02 16:53:27 +00:00
labs(fill="Percentile") +
2020-01-23 09:48:36 +00:00
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
2019-11-01 14:34:23 +00:00
coord_cartesian(ylim=c(0,600)) +
2020-01-23 09:48:36 +00:00
geom_hline(yintercept = 160, linetype="dashed", color="white") +
annotate("text", x=4, y=160, label = "QoS: OWD best", vjust = -1, color="white") +
geom_hline(yintercept = 360) +
annotate("text", x=4, y=360, label = "QoS: OWD limit", vjust = -1,color="black") +
theme_classic() +
theme(legend.position="none") +
facet_grid( . ~ strat)
2019-10-31 17:05:47 +00:00
2019-11-02 14:19:15 +00:00
e <- read.csv("../../donar-res/tmp_light/links3.csv")
2019-10-31 17:05:47 +00:00
e$strat <- as.factor(e$strat)
e$links <- as.factor(e$links)
2020-01-23 09:48:36 +00:00
e$strat <- revalue(e$strat, c("1"="TickTock", "0"="Duplicate"))
2019-11-02 16:53:27 +00:00
e$percentile <-factor(e$percentile,levels=c("MAX", "P99.9", "P99", "P75", "P50", "P25", "P1", "P0.1", "MIN"))
2019-10-31 17:05:47 +00:00
e <- e %>% mutate (lat = latency / 1000)
2020-01-23 09:48:36 +00:00
elinks <- sqldf("select * from e where percentile != 'MAX' and percentile != 'P1' and percentile != 'P0.1' and links != 6 and links != 4") %>% arrange(percentile)
2019-11-02 16:53:27 +00:00
ge <- ggplot(sqldf("select * from e where percentile != 'MAX' and percentile != 'P1' and percentile != 'P0.1' and links != 6 and links != 4") %>% arrange(percentile), aes(x=strat:links,y=lat,group=percentile,fill=percentile)) +
2020-01-23 09:48:36 +00:00
geom_bar(stat='identity', position='identity', width=1, color="black") +
2019-10-31 17:05:47 +00:00
scale_fill_grey() +
2019-11-01 14:34:23 +00:00
ylab("Latency (ms)") +
xlab("Strategy:Links") +
2019-11-02 16:53:27 +00:00
labs(fill="Percentile") +
2019-10-31 17:05:47 +00:00
geom_hline(yintercept = 200) +
geom_hline(yintercept = 400) +
2019-11-01 14:34:23 +00:00
coord_cartesian(ylim=c(0,600)) +
2019-10-31 17:05:47 +00:00
theme_classic()
2019-11-01 14:34:23 +00:00
2019-11-02 16:53:27 +00:00
f <- read.csv("../../donar-res/tmp_light/fast3.csv")
2019-11-01 14:34:23 +00:00
f$strat <- as.factor(f$strat)
2020-01-23 09:48:36 +00:00
f$strat <- revalue(f$strat, c("1"="TickTock", "0"="Duplicate"))
2019-11-01 14:34:23 +00:00
f$fast_count <- as.factor(f$fast_count)
2019-11-02 16:53:27 +00:00
f$percentile <-factor(f$percentile,levels=c("MAX", "P99.9", "P99", "P75", "P50", "P25", "P1", "P0.1", "MIN"))
2019-11-01 14:34:23 +00:00
f <- f %>% mutate (lat = latency / 1000)
2020-01-23 09:48:36 +00:00
ffast <- sqldf("select * from f where percentile != 'MAX' and percentile != 'P1' and percentile != 'P0.1'") %>% arrange(percentile)
gf <- ggplot(ffast, aes(x=strat:fast_count,y=lat,group=percentile,fill=percentile)) +
2019-11-01 14:34:23 +00:00
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") +
2019-11-02 16:53:27 +00:00
labs(fill="Percentile") +
2019-11-01 14:34:23 +00:00
theme_classic()
2020-01-23 09:48:36 +00:00
plot_grid(gd, gdbis, ge, ge, gf, gf, ncol=3) +
ggsave("light_config.pdf", dpi=300, dev='pdf', height=17, width=15, units="cm")
mega <- sqldf("
select window as variable, lat, strat, percentile, 'Window (sec)' as variable_name from dwin
union
select links as variable, lat, strat, percentile, '# of total links' as variable_name from elinks
union
select fast_count as variable, lat, strat, percentile, '# of fast links' as variable_name from ffast
") %>% arrange(percentile)
mega$percentile <- revalue(mega$percentile, c("P99.9" = "99.9%", "P99" = "99%", "P75"="75%", "P50" = "50%", "P25" = "25%", "MIN" = "Min"))
mega$variable <- factor(mega$variable, levels =c("0.2", "1", "2", "3", "4", "5", "6", "8", "10", "12", "13", "14", "16", "20", "34"))
QoS <- data.frame(x = c(1.2, 1.5), name = c("bar", "foo"))
ggplot(mega, aes(x=variable,y=lat,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity', color="black", width=1) +
scale_fill_bw_qdu_6 +
ylab("Latency (ms)") +
xlab("Protocol Parameter Value") +
labs(fill="Distribution") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
coord_cartesian(ylim=c(0,600)) +
geom_hline(aes(yintercept = 110, linetype="Target One Way Delay"), color="grey") +
#annotate("text", x=4, y=160, label = "OWD best", vjust = 1.5, color="white") +
geom_hline(aes(yintercept = 360, linetype="Max One Way Delay"), color="grey") +
#annotate("text", x=4, y=360, label = "OWD limit", vjust = -1, color="black") +
theme_classic() +
theme(legend.position="top",
legend.direction = "horizontal",
legend.box = "vertical",
panel.spacing.y = unit(4, "mm"),
strip.placement = "outside",
legend.margin=margin(t = -0.1, unit='cm')) +
guides(fill = guide_legend(nrow = 1)) +
facet_grid(strat ~ variable_name, scales = "free", switch = "x") +
scale_linetype_manual(name = "QoS", values = c(1, 2), guide = guide_legend(override.aes = list(linetype = c("solid", "dashed")))) +
ggsave("light_config.pdf", dpi=300, dev='pdf', height=12.5, width=12.5, units="cm")
2019-11-02 16:53:27 +00:00
g <- read.csv("../../donar-res/tmp_light/guards.csv")
2019-11-02 14:19:15 +00:00
g$strat <- as.factor(g$strat)
2020-01-23 09:48:36 +00:00
g$strat <- revalue(g$strat, c("1"="TickTock", "0"="Duplicate"))
2019-11-02 14:19:15 +00:00
g$guard <- as.factor(g$guard)
2020-01-23 09:48:36 +00:00
g$percentile <- revalue(g$percentile, c("MAX" = "100%", "P99.9"="99.9%", "P99"="99%", "P75" = "75%", "P50"="50%","P25"="25%","P1"="1%","P0.1"="0.1%","MIN"="Min"))
2019-11-02 14:19:15 +00:00
g$guard <- revalue(g$guard, c("guard_1"="1", "guard_3"="3", "guard_5"="5", "guard_7"="7", "guard_9"="9", "guard_11"="11", "simple"="inf"))
g$guard <- factor(g$guard, levels=c("1", "3", "5", "7", "9", "11", "inf"))
2020-01-23 09:48:36 +00:00
g$percentile <-factor(g$percentile,levels=c("100%", "99.9%", "99%", "75%", "50%", "25%", "1%", "0.1%", "Min"))
2019-11-02 14:19:15 +00:00
g <- g %>% mutate (lat = latency / 1000)
2020-01-23 09:48:36 +00:00
gg <- ggplot(sqldf("select * from g where percentile != '100%' and percentile != '1%' and percentile != '0.1%' ") %>% arrange(percentile), aes(x=guard,y=lat,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity', width=1, color="black") +
scale_fill_bw_qdu_6 +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
2019-11-02 14:19:15 +00:00
coord_cartesian(ylim=c(0,600)) +
ylab("Latency (ms)") +
2020-01-23 09:48:36 +00:00
xlab("# of guards") +
labs(fill="Distribution") +
scale_linetype_manual(name = "QoS", values = c(1, 2), guide = guide_legend(override.aes = list(linetype = c("solid", "dashed")))) +
geom_hline(aes(yintercept = 110, linetype="Target One Way Delay"), color="grey") +
geom_hline(aes(yintercept = 360, linetype="Max One Way Delay"), color="grey") +
facet_grid(. ~ strat, scales = "free", switch = "x") +
theme_classic() +
guides(fill = guide_legend(nrow = 1)) +
theme(strip.placement = "outside",
legend.position="top",
legend.direction = "horizontal",
legend.box = "vertical",
legend.margin=margin(t = -0.2, l=-0.8, unit='cm'))
2019-11-02 14:19:15 +00:00
2020-01-23 09:48:36 +00:00
gg + ggsave("light_guards.pdf", dpi=300, dev='pdf', height=7.5, width=12.5, units="cm")
2019-11-02 16:53:27 +00:00
2019-11-27 15:08:44 +00:00
h <- read.csv("../../donar-res/tmp_light/complem.csv")
2020-01-23 09:48:36 +00:00
h$strat <- revalue(h$strat, c("ticktock"="TickTock", "duplicate"="Duplicate"))
h$percentile <- revalue(h$percentile, c("MAX" = "100%", "P99.9"="99.9%", "P99"="99%", "P75" = "75%", "P50"="50%","P25"="25%","P1"="1%","P0.1"="0.1%","MIN"="Min"))
h$percentile <-factor(h$percentile,levels=c("100%", "99.9%", "99%", "75%", "50%", "25%", "1%", "0.1%", "Min"))
2019-11-27 15:08:44 +00:00
h$mode <- factor(h$mode, levels=c("no_redundancy", "no_scheduler", "donar"))
h$mode <- revalue(h$mode, c("no_redundancy" = "scheduler", "no_scheduler" = "padding", "donar"="both"))
h <- h %>% mutate (lat = latency / 1000)
2020-01-23 09:48:36 +00:00
gh <- ggplot(sqldf("select * from h where percentile != '100%' and percentile != '1%' and percentile != '0.1%' ") %>% arrange(percentile), aes(x=mode,y=lat,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity', width=1, color="black") +
scale_fill_bw_qdu_6 +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
scale_linetype_manual(name = "QoS", values = c(1, 2), guide = guide_legend(override.aes = list(linetype = c("solid", "dashed")))) +
geom_hline(aes(yintercept = 110, linetype="Target One Way Delay"), color="grey") +
geom_hline(aes(yintercept = 360, linetype="Max One Way Delay"), color="grey") +
2019-11-27 15:08:44 +00:00
coord_cartesian(ylim=c(0,500)) +
ylab("Latency (ms)") +
2020-01-23 09:48:36 +00:00
xlab("Feature") +
labs(fill="Distribution") +
facet_grid(. ~ strat, scales = "free", switch = "x") +
theme_classic() +
guides(fill = guide_legend(nrow = 1)) +
theme(strip.placement = "outside",
legend.position="top",
legend.direction = "horizontal",
legend.box = "vertical",
legend.margin=margin(t = -0.2, l=-0.8, unit='cm'))
gh + ggsave("light_complementary.pdf", dpi=300, dev='pdf', height=7.5, width=12.5, units="cm")
2019-11-27 15:08:44 +00:00
i <- read.csv("../../donar-res/tmp_light/battle.csv")
2020-01-23 09:48:36 +00:00
i$percentile <- revalue(i$percentile, c("MAX" = "100%", "P99.9"="99.9%", "P99"="99%", "P75" = "75%", "P50"="50%","P25"="25%","P1"="1%","P0.1"="0.1%","MIN"="Min"))
i$percentile <-factor(i$percentile,levels=c("100%", "99.9%", "99%", "75%", "50%", "25%", "1%", "0.1%", "Min"))
2019-11-27 15:08:44 +00:00
i <- i %>% mutate (lat = latency / 1000)
i$secmode <- factor(i$secmode, levels=c("hardened", "default", "light"))
i$algo <- factor(i$algo, levels=c("simple", "dup2", "lightning-ticktock", "lightning-dup"))
i$algo <- revalue(i$algo, c("dup2"="torfone", "simple"="simple", "lightning-ticktock"="donar-ticktock", "lightning-dup"="donar-dup"))
2020-01-23 09:48:36 +00:00
gi <- ggplot(sqldf("select * from i where percentile != '100%' and percentile != '1%' and percentile != '0.1%' ") %>% arrange(percentile), aes(x=algo,y=lat,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity',width=1,color="black") +
scale_fill_bw_qdu_6 +
2019-11-27 15:08:44 +00:00
scale_y_continuous(expand = c(0, 0)) +
scale_x_discrete(expand = c(0, 0)) +
2020-01-23 09:48:36 +00:00
#scale_fill_viridis_d() +
geom_hline(aes(yintercept = 110, linetype="Target One Way Delay"), color="grey") +
geom_hline(aes(yintercept = 360, linetype="Max One Way Delay"), color="grey") +
2019-11-27 15:08:44 +00:00
coord_cartesian(ylim=c(0,600)) +
ylab("Latency (ms)") +
xlab("Algorithm") +
2020-01-23 09:48:36 +00:00
labs(fill="Distribution", title="linear scale, cropped") +
2019-11-27 15:08:44 +00:00
theme_classic() +
2020-01-23 09:48:36 +00:00
scale_linetype_manual(name = "QoS", values = c(1, 2), guide = guide_legend(override.aes = list(linetype = c("solid", "dashed")))) +
guides(fill = guide_legend(nrow = 1)) +
facet_grid(. ~ secmode, scales = "free", switch = "x") +
theme(axis.text.x = element_text(angle = 20, hjust=1),
plot.margin = unit(c(0.3,0.2,0.2,1), "cm"),
strip.placement = "outside",
legend.position="none",
legend.direction = "horizontal",
legend.box = "vertical",
legend.margin=margin(t = -0.1, unit='cm'))
gibis <- ggplot(sqldf("select * from i where percentile != '100%' and percentile != '1%' and percentile != '0.1%' ") %>% arrange(percentile), aes(x=algo,y=lat,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity', color="black", width=1) +
scale_fill_bw_qdu_6 +
2019-11-27 15:08:44 +00:00
scale_y_log10() +
2020-01-23 09:48:36 +00:00
#geom_hline(aes(yintercept = 160, linetype="Target One Way Delay"), color="grey") +
#geom_hline(aes(yintercept = 360, linetype="Max One Way Delay"), color="grey") +
scale_x_discrete(expand = c(0, 0)) +
coord_cartesian(ylim=c(30,250000)) +
2019-11-27 15:08:44 +00:00
ylab("Latency (ms)") +
2020-01-23 09:48:36 +00:00
xlab("Algorithm") +
labs(fill="Distribution", title="log scale, full") +
facet_grid(. ~ secmode, scales = "free", switch = "x") +
2019-11-27 15:08:44 +00:00
theme_classic() +
2020-01-23 09:48:36 +00:00
theme(legend.position="none",
axis.text.x = element_text(angle = 20, hjust=1),
plot.margin = unit(c(0.2,0.2,0.2,1), "cm"),
strip.placement = "outside")
gilegend <- get_legend(gi + theme(legend.position = "top"))
2019-11-27 15:08:44 +00:00
2020-01-23 09:48:36 +00:00
plot_grid(gilegend, plot_grid(gibis, gi, align="v", ncol=1), ncol=1, rel_heights = c(1,6)) +
ggsave("light_battle.pdf", dpi=300, dev='pdf', height=15, width=12.5, units="cm")
#gi + ggsave("battle_color.pdf", dpi=300, dev='pdf', height=7, width=12, units='cm')
2019-11-27 15:08:44 +00:00
fastprobe = read.csv(text=
"
group,pad,count,strat
fast,orig,0.47348781884198304,ticktock
fast,pad,0.2629428441715532,ticktock
probe,orig,0.23705662669600178,ticktock
probe,pad,0.026512710290461965,ticktock
probe,orig,0.1154165656941915,duplicate
probe,pad,0.015345347029610245,duplicate
fast,orig,0.7349205324574037,duplicate
fast,pad,0.13431755481879454,duplicate
")
gj <- ggplot(fastprobe, aes(x=group:pad, y=count, fill=strat)) +
geom_bar(stat='identity', position='dodge') +
scale_fill_grey() +
ylab("Count") +
xlab("Group:Padding") +
labs(fill="Strategy") +
scale_y_continuous(labels = scales::percent) +
theme_classic() +
theme(axis.text.x = element_text(angle = 20, hjust=1))
gj + ggsave("light_fastprobe.png", dpi=300, dev='png', height=7, width=15, units="cm")
2020-01-23 09:48:36 +00:00
fastprobe2 = read.csv(text="
strat,schedule_state,packet_position,ratio
Ticktock,tick,original on 1st class,0.946975638
Ticktock,tick,piggybacked on 2nd class,0.053025421
Ticktock,tock,original on 2nd class,0.474113253
Ticktock,tock,piggybacked on 1st class,0.525885688
Duplicate,all,original on 1st class,0.7349205324574037
Duplicate,all,piggybacked on 1st class,0.13431755481879454
Duplicate,all,original on 2nd class,0.1154165656941915
Duplicate,all,piggybacked on 2nd class,0.015345347029610245
")
fastprobe2$schedule_state <-factor(fastprobe2$schedule_state,levels=c("all", "tock", "tick"))
ggplot(fastprobe2, aes(x=schedule_state, y=ratio, fill=packet_position)) +
geom_bar(stat='identity', position='stack', width=1, color="black") +
facet_grid(strat ~ ., scales = "free", switch = "x") +
scale_y_continuous(expand = c(0, 0), labels = scales::percent) +
scale_x_discrete(expand = c(0, 0)) +
scale_fill_bw_qdu_4 +
xlab("Schedule State") +
ylab("Fastest Delivery") +
labs(fill="Scheduling Decision") +
coord_flip() +
theme_classic() +
ggsave("light_fastprobe.pdf", dpi=300, dev='pdf', height=5, width=12.5, units="cm")
2019-11-27 15:08:44 +00:00
fastlinks = read.csv(text=
"
link_count,occ_count,strat
2020-01-23 09:48:36 +00:00
5,0,Ticktock
9,0.20634920634920634,Ticktock
8,0.25396825396825395,Ticktock
7,0.1111111111111111,Ticktock
6,0.1746031746031746,Ticktock
10,0.1746031746031746,Ticktock
11,0.07936507936507936,Ticktock
12,0,Ticktock
9,0.19047619047619047,Duplicate
8,0.14285714285714285,Duplicate
10,0.20634920634920634,Duplicate
7,0.09523809523809523,Duplicate
6,0.09523809523809523,Duplicate
11,0.14285714285714285,Duplicate
5,0.015873015873015872,Duplicate
12,0.1111111111111111,Duplicate
2019-11-27 15:08:44 +00:00
")
gk <- ggplot(fastlinks, aes(x=link_count, y=occ_count, fill=strat)) +
2020-01-23 09:48:36 +00:00
geom_bar(stat='identity', position='dodge', color="black") +
2019-11-27 15:08:44 +00:00
scale_fill_grey() +
2020-01-23 09:48:36 +00:00
ylab("Calls") +
2019-11-27 15:08:44 +00:00
xlab("Links fast at least once") +
labs(fill="Strategy") +
2020-01-23 09:48:36 +00:00
scale_y_continuous(expand = c(0, 0), labels = scales::percent) +
scale_x_continuous(expand = c(0, 0)) +
2019-11-27 15:08:44 +00:00
theme_classic()
#theme(axis.text.x = element_text(angle = 20, hjust=1))
2020-01-23 09:48:36 +00:00
gk + ggsave("light_fastlinks.pdf", dpi=300, dev='pdf', height=6, width=12.5, units="cm")
2019-11-27 15:08:44 +00:00
l <- read.csv("../../donar-res/tmp_light/basic.csv")
l <- l %>% mutate (lat = latency / 1000)
gl <- ggplot(sqldf("select * from l where way='client'"), aes(x=packet_id,y=lat)) +
coord_cartesian(ylim=c(0,500)) +
2020-01-23 09:48:36 +00:00
scale_y_continuous(expand = c(0, 0)) +
scale_x_continuous(expand = c(0, 0)) +
2019-11-27 15:08:44 +00:00
xlab("Packet Identifier") +
ylab("Latency (ms)") +
labs(linetype="Way") +
2020-01-23 09:48:36 +00:00
geom_point(size=0.1) +
geom_hline(aes(yintercept = 110, linetype="Target One Way Delay"), color="white") +
geom_hline(aes(yintercept = 360, linetype="Max One Way Delay"), color="grey") +
scale_linetype_manual(name = "QoS", values = c(1, 2), guide = guide_legend(override.aes = list(linetype = c("solid", "dashed")))) +
theme_classic() +
theme(legend.position="top",legend.margin=margin(t = -0.1, b = -0.1, unit='cm'))
#gl + ggsave("light_single.png", dpi=300, dev='png', height=7, width=15, units="cm")
2019-11-27 15:08:44 +00:00
m <- read.csv("../../donar-res/tmp_light/fp.csv")
m <- m %>% mutate (lat = latency / 1000)
2020-01-23 09:48:36 +00:00
m$group <- revalue(m$group, c("fast" = "1st class links", "probe" = "2nd class links"))
2019-11-27 15:08:44 +00:00
gm <- ggplot(sqldf("select * from m where `way`='client'"), aes(x=packet_id,y=lat,color=group)) +
scale_color_grey() +
coord_cartesian(ylim=c(0,500)) +
2020-01-23 09:48:36 +00:00
scale_y_continuous(expand = c(0, 0)) +
scale_x_continuous(expand = c(0, 0)) +
2019-11-27 15:08:44 +00:00
xlab("Packet Identifier") +
ylab("Latency (ms)") +
2020-01-23 09:48:36 +00:00
labs(color="Link Group") +
2019-11-27 15:08:44 +00:00
labs(linetype="Way") +
2020-01-23 09:48:36 +00:00
geom_point(size=0.1) +
geom_hline(yintercept = 110, linetype="dashed", color="white") +
geom_hline(yintercept = 360, linetype="solid", color="grey") +
guides(color = guide_legend(override.aes = list(size=2))) +
theme_classic() +
theme(legend.position="top", legend.margin=margin(t = -0.1, b = -0.1, unit='cm'))
2019-11-27 15:08:44 +00:00
n <- read.csv("../../donar-res/tmp_light/linkgroup.csv")
2020-01-23 09:48:36 +00:00
n$group <- revalue(n$group, c("fast" = "1st class links", "probe" = "2nd class links"))
#n$link_id <- as.factor(n$link_id)
2019-11-27 15:08:44 +00:00
gn <- ggplot(n, aes(x=packet_id, y=link_id, color=group)) +
scale_color_grey() +
2020-01-23 09:48:36 +00:00
scale_fill_grey() +
geom_point(size=0.6) +
scale_y_continuous(expand = c(0.1, 0.1)) +
scale_x_continuous(expand = c(0, 0)) +
2019-11-27 15:08:44 +00:00
#scale_color_viridis_d() +
xlab("Packet Identifier") +
ylab("Link Identifier") +
2020-01-23 09:48:36 +00:00
labs(color="Link group") +
#geom_tile() +
theme_classic() +
theme(legend.position="none")
2019-11-27 15:08:44 +00:00
2020-01-23 09:48:36 +00:00
plot_grid(gl, gm, gn, ncol=1,align="v",rel_heights = c(1.3,1.3,1)) + ggsave("light_single.pdf", dpi=300, dev='pdf', height=12.5, width=12.5, units="cm")
2019-11-27 15:08:44 +00:00
gn+ggsave("links_group.pdf", dpi=300, dev='pdf', height=7, width=15, units="cm")
o <- read.csv("../../donar-res/tmp_light/torrate.csv")
o <- o %>% mutate (latency = latency / 1000)
o <- o %>% mutate (rate = round(rate, 0))
q1coefs <- coef(lm(latency ~ rate, data = sqldf("select rate, latency from o where percentile= 'P25'")))
mcoefs <- coef(lm(latency ~ rate, data = sqldf("select rate, latency from o where percentile= 'P50'")))
q3coefs <- coef(lm(latency ~ rate, data = sqldf("select rate, latency from o where percentile= 'P75'")))
o$percentile <- revalue(o$percentile, c("MAX"="100%", "MIN" = "0%", "P99.9" = "99.9%", "P99" = "99%", "P75" = "75%", "P50" = "50%", "P25" = "25%"))
o$percentile <-factor(o$percentile,levels=c("100%", "99.9%", "99%", "75%", "50%", "25%", "1%", "0.1%", "0%"))
o$rate <- factor(o$rate)
go <- ggplot(sqldf("select * from o where percentile != 'MAX' and percentile != 'P1' and percentile != 'P0.1'") %>% arrange(percentile), aes(x=rate,y=latency,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity', width=1) +
#scale_fill_grey() +
scale_fill_viridis_d(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
scale_x_discrete(expand = c(0, 0)) +
ylab("Latency (ms)") +
xlab("Packets / second") +
labs(fill="Distribution") +#, title="low values") +
coord_cartesian(ylim=c(0,500)) +
geom_hline(yintercept = 200) +
geom_hline(yintercept = 400) +
#geom_abline(intercept = q1coefs[1], slope = q1coefs[2], linetype='dashed') +
#geom_abline(intercept = mcoefs[1], slope = mcoefs[2], linetype='dashed') +
#geom_abline(intercept = q3coefs[1], slope = q3coefs[2], linetype='dashed') +
theme_classic()
gp <- ggplot(sqldf("select * from o where percentile != 'MAX' and percentile != 'P1' and percentile != 'P0.1'") %>% arrange(percentile), aes(x=rate,y=latency,group=percentile,fill=percentile)) +
geom_bar(stat='identity', position='identity') +
scale_fill_grey() +
scale_y_log10() +
ylab("Latency (ms)") +
xlab("Packets / second") +
labs(fill="Percentile", title="high values (log scale)") +
coord_cartesian(ylim=c(100,100000)) +
geom_hline(yintercept = 200) +
geom_hline(yintercept = 400) +
theme_classic()
plot_grid(gp, go, align = "v", axis = "l", ncol=1) + ggsave("torrate.pdf", dpi=300, dev='pdf', height=12, width=15, units="cm")
go + ggsave("torrate_scale.pdf", dpi=300, dev='pdf', height=6, width=12, units='cm')