diff --git a/r/lightning_begin.R b/r/lightning_begin.R index 7e3e98d..b237fb9 100644 --- a/r/lightning_begin.R +++ b/r/lightning_begin.R @@ -10,25 +10,31 @@ ggplot(data=link_info, aes(x=timestamp, y=link, color=speed)) + theme_classic() -xx <- read.csv("../res/tmp_light/a.csv") +xx <- read.csv("../res/tmp_light/g.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() + - coord_cartesian(ylim=c(0,2000)) + + geom_hline(yintercept=400) + + geom_hline(yintercept=200) + + coord_cartesian(ylim=c(0,1000)) + #geom_point() + theme_classic() -xx4 <- sqldf("select packet_id,1.0 * latency / 1000.0 as lat,way from xx where flag = 0") +xx4 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx where flag = 0 group by packet_id,way") ggplot(data=xx4, aes(x=packet_id, y=lat, color=way)) + geom_line() + + geom_hline(yintercept=400) + + geom_hline(yintercept=200) + coord_cartesian(ylim=c(0,1000)) + #geom_point() + theme_classic() -xx5 <- sqldf("select packet_id,1.0 * latency / 1000.0 as lat,way from xx where flag = 1") +xx5 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,way from xx where flag = 1 group by packet_id,way") ggplot(data=xx5, aes(x=packet_id, y=lat, color=way)) + geom_line() + + geom_hline(yintercept=400) + + geom_hline(yintercept=200) + coord_cartesian(ylim=c(0,1000)) + #geom_point() + theme_classic() @@ -53,7 +59,7 @@ where s.way = r.way and r.lat = s.latency") -xx3 <- sqldf("select packet_id,1.0 * latency / 1000.0 as lat,flag,way from xx") +xx3 <- sqldf("select packet_id,1.0 * MIN(latency) / 1000.0 as lat,flag,way from xx group by packet_id,way,flag") xx3$flag <- factor(xx3$flag) ggplot(data=xx3, aes(x=lat, group=flag, color=flag)) + stat_ecdf(pad = FALSE) +