WIP my graph

This commit is contained in:
Quentin 2019-09-17 23:05:52 +02:00
parent 09ef754312
commit 0c959ac6b6

View file

@ -236,10 +236,19 @@ t3 <- plot_grid(v8, v9, v10, v11, labels = c('A', 'B', 'C', 'D'), ncol=2)
t3 + ggsave("thunder_packets.png", dpi=300, dev='png', height=12, width=15, units="cm") t3 + ggsave("thunder_packets.png", dpi=300, dev='png', height=12, width=15, units="cm")
tor_multi_lat <- read.csv("tor_just_many_latencies.csv") tor_multi_lat <- read.csv("tor_just_many_latencies.csv")
tor_drop <- sqldf("select run,conf,1.0*MAX(ident)/33 as last_one from tor_multi_lat group by run,conf") tor_multi_lat_100 <- read.csv("tor_just_many_latencies_100.csv")
v12 <- ggplot(data=tor_drop,aes(x=last_one)) +
tor_drop <- sqldf(
"
select run,conf,1.0*MAX(ident)/33 as last_one,'33' as pkt_sec from tor_multi_lat group by run,conf
union
select run,conf,1.0*MAX(ident)/10 as last_one, '10' as pkt_sec from tor_multi_lat_100 group by run,conf
")
v12 <- ggplot(data=tor_drop,aes(x=last_one, linetype=factor(pkt_sec, levels=c('33', '10')))) +
stat_ecdf(pad = FALSE) + stat_ecdf(pad = FALSE) +
ylab("% broken links") + ylab("% broken links") +
labs(linetype="Pkt/sec") +
coord_cartesian(xlim = c(0, 300), ylim = c(0,0.5)) + coord_cartesian(xlim = c(0, 300), ylim = c(0,0.5)) +
scale_y_continuous(labels = scales::percent) + scale_y_continuous(labels = scales::percent) +
xlab("Elapsed time (sec)") + xlab("Elapsed time (sec)") +
@ -252,22 +261,155 @@ library(purrr)
library(tidyr) library(tidyr)
tor_lat_stack <- tor_multi_lat %>% tor_lat_stack <- tor_multi_lat %>%
dplyr::mutate(latency = latency / 1000) %>%
dplyr::group_by(run,conf) %>% dplyr::group_by(run,conf) %>%
dplyr::summarise( dplyr::summarise(
id = paste(first(run),first(conf)), id = paste(first(run),first(conf)),
min = min(latency), min = min(latency),
max = max(latency), q25 = quantile(latency,0.25) - min(latency),
median = median(latency) - quantile(latency,0.25),
q75 = quantile(latency,0.75) - median(latency),
q95 = quantile(latency,0.95) - quantile(latency,0.75),
q99 = quantile(latency,0.99) - quantile(latency,0.95),
max = max(latency) - quantile(latency,0.99),
max_sort = max(latency), max_sort = max(latency),
q25 = quantile(latency,0.25), median_sort = median(latency)
median = median(latency),
median_sort = median(latency),
q75 = quantile(latency,0.75),
q95 = quantile(latency,0.95),
q99 = quantile(latency,0.99)
) )
tor_lat_stack <- gather(tor_lat_stack, 'min', 'max', 'q25', 'median', 'q75', 'q95', 'q99', key="quantile_name", value="quantile_value") tor_lat_stack <- gather(tor_lat_stack, 'min', 'max', 'q25', 'median', 'q75', 'q95', 'q99', key="quantile_name", value="quantile_value")
ggplot(tor_lat_stack, aes(x=id,y=quantile_value,fill=quantile_name)) + v13 <- ggplot(tor_lat_stack, aes(
ylim(0,1000000) + x=reorder(id,median_sort),
geom_bar(stat="identity", position="dodge") y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(), axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"))
v14 <- ggplot(tor_lat_stack, aes(
x=reorder(id,median_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
#coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(),axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"))
v15 <- ggplot(tor_lat_stack, aes(
x=reorder(id,max_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(), axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"), plot.tag.position='top')
v16 <- ggplot(tor_lat_stack, aes(
x=reorder(id,max_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
#coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(), axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"),plot.tag.position='bottom')
t4 <- plot_grid(v16, v15, v14, v13, labels = c('A', 'B', 'C', 'D'), ncol=1)
t4 + ggsave("tor_30ms.png", dpi=300, dev='png', height=20, width=15, units="cm")
tor_lat_stack_100 <- tor_multi_lat_100 %>%
dplyr::mutate(latency = latency / 1000) %>%
dplyr::group_by(run,conf) %>%
dplyr::summarise(
id = paste(first(run),first(conf)),
min = min(latency),
q25 = quantile(latency,0.25) - min(latency),
median = median(latency) - quantile(latency,0.25),
q75 = quantile(latency,0.75) - median(latency),
q95 = quantile(latency,0.95) - quantile(latency,0.75),
q99 = quantile(latency,0.99) - quantile(latency,0.95),
max = max(latency) - quantile(latency,0.99),
max_sort = max(latency),
median_sort = median(latency)
)
tor_lat_stack_100 <- gather(tor_lat_stack_100, 'min', 'max', 'q25', 'median', 'q75', 'q95', 'q99', key="quantile_name", value="quantile_value")
v17 <- ggplot(tor_lat_stack_100, aes(
x=reorder(id,median_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(), axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"))
v18 <- ggplot(tor_lat_stack_100, aes(
x=reorder(id,median_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
#coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(),axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"))
v19 <- ggplot(tor_lat_stack_100, aes(
x=reorder(id,max_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(), axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"), plot.tag.position='top')
v20 <- ggplot(tor_lat_stack_100, aes(
x=reorder(id,max_sort),
y=quantile_value,
fill=factor(quantile_name, levels=c('max','q99','q95','q75', 'median', 'q25', 'min')))
) +
#coord_cartesian(ylim = c(0,1500)) +
labs(fill="quantile")+
xlab("Tor circuits") +
ylab("RTT (ms)") +
geom_bar(stat="identity", position="stack",width=1) +
scale_fill_grey() +
theme_classic() +
theme(axis.text.x=element_blank(), axis.ticks.x = element_blank(), legend.key.size = unit(0.2, "cm"),plot.tag.position='bottom')
t5 <- plot_grid(v20, v19, v18, v17, labels = c('A', 'B', 'C', 'D'), ncol=1)
t5 + ggsave("tor_100ms.png", dpi=300, dev='png', height=20, width=15, units="cm")