2019-10-08 14:48:00 +00:00
|
|
|
library(ggplot2)
|
|
|
|
library(sqldf)
|
|
|
|
library(plyr)
|
|
|
|
library(cowplot)
|
|
|
|
|
2019-10-11 12:45:21 +00:00
|
|
|
link_info <- read.csv("../res/tmp_graph/u.txt")
|
2019-10-08 14:48:00 +00:00
|
|
|
ggplot(data=link_info, aes(x=timestamp, y=link, color=speed)) +
|
|
|
|
#geom_line() +
|
|
|
|
geom_point() +
|
|
|
|
theme_classic()
|
|
|
|
|
|
|
|
|
2019-10-16 15:17:41 +00:00
|
|
|
xx <- read.csv("../res/tmp_light/o.csv")
|
2019-10-09 15:07:51 +00:00
|
|
|
xx2 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx group by packet_id,way")
|
2019-10-08 14:48:00 +00:00
|
|
|
ggplot(data=xx2, aes(x=packet_id, y=lat, color=way)) +
|
2019-10-09 15:07:51 +00:00
|
|
|
geom_line() +
|
2019-10-16 13:07:34 +00:00
|
|
|
geom_hline(yintercept=400) +
|
|
|
|
geom_hline(yintercept=200) +
|
|
|
|
coord_cartesian(ylim=c(0,1000)) +
|
2019-10-09 15:07:51 +00:00
|
|
|
#geom_point() +
|
2019-10-08 14:48:00 +00:00
|
|
|
theme_classic()
|
2019-10-09 15:41:16 +00:00
|
|
|
|
2019-10-16 13:07:34 +00:00
|
|
|
xx4 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx where flag = 0 group by packet_id,way")
|
2019-10-11 09:01:09 +00:00
|
|
|
ggplot(data=xx4, aes(x=packet_id, y=lat, color=way)) +
|
|
|
|
geom_line() +
|
2019-10-16 13:07:34 +00:00
|
|
|
geom_hline(yintercept=400) +
|
|
|
|
geom_hline(yintercept=200) +
|
2019-10-15 12:22:45 +00:00
|
|
|
coord_cartesian(ylim=c(0,1000)) +
|
2019-10-11 09:01:09 +00:00
|
|
|
#geom_point() +
|
|
|
|
theme_classic()
|
|
|
|
|
|
|
|
|
2019-10-16 13:07:34 +00:00
|
|
|
xx5 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx where flag = 1 group by packet_id,way")
|
2019-10-11 09:01:09 +00:00
|
|
|
ggplot(data=xx5, aes(x=packet_id, y=lat, color=way)) +
|
|
|
|
geom_line() +
|
2019-10-16 13:07:34 +00:00
|
|
|
geom_hline(yintercept=400) +
|
|
|
|
geom_hline(yintercept=200) +
|
2019-10-15 12:22:45 +00:00
|
|
|
coord_cartesian(ylim=c(0,1000)) +
|
2019-10-11 09:01:09 +00:00
|
|
|
#geom_point() +
|
|
|
|
theme_classic()
|
|
|
|
|
|
|
|
|
2019-10-09 15:41:16 +00:00
|
|
|
prepros <- sqldf(
|
|
|
|
"select
|
|
|
|
r.packet_id,
|
|
|
|
r.way,
|
|
|
|
r.lat,
|
|
|
|
s.flag
|
|
|
|
from
|
|
|
|
(select
|
|
|
|
packet_id,
|
|
|
|
way,
|
|
|
|
min(latency) as lat
|
|
|
|
from xx
|
|
|
|
group by packet_id,way) as r,
|
|
|
|
xx as s
|
|
|
|
where
|
|
|
|
s.packet_id = r.packet_id and
|
|
|
|
s.way = r.way and
|
|
|
|
r.lat = s.latency")
|
2019-10-11 09:01:09 +00:00
|
|
|
|
2019-10-16 13:07:34 +00:00
|
|
|
xx3 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,flag,way from xx group by packet_id,way,flag")
|
2019-10-11 09:01:09 +00:00
|
|
|
xx3$flag <- factor(xx3$flag)
|
|
|
|
ggplot(data=xx3, aes(x=lat, group=flag, color=flag)) +
|
|
|
|
stat_ecdf(pad = FALSE) +
|
2019-10-16 14:45:10 +00:00
|
|
|
geom_vline(xintercept = 200) +
|
|
|
|
geom_vline(xintercept = 400) +
|
2019-10-15 12:22:45 +00:00
|
|
|
coord_cartesian(xlim=c(0,1200)) +
|
2019-10-11 09:01:09 +00:00
|
|
|
theme_classic()
|