Add some logic to parse links
This commit is contained in:
parent
0b736c9a27
commit
3810a32fa1
2 changed files with 22 additions and 4 deletions
|
@ -3,7 +3,7 @@ library(sqldf)
|
|||
library(plyr)
|
||||
library(cowplot)
|
||||
|
||||
thunder_ms <- read.csv("thunder_configure_11.csv")
|
||||
thunder_ms <- read.csv("thunder_configure_12.csv")
|
||||
|
||||
thunder_ms <- sqldf("select run,jmax,links,latency, CAST(latency as real) / 1000. as lat_ms from thunder_ms")
|
||||
thunder_ms$links <- as.factor(thunder_ms$links)
|
||||
|
@ -11,13 +11,18 @@ thunder_ms$jmax <- as.factor(thunder_ms$jmax)
|
|||
|
||||
v1 <- ggplot(data = thunder_ms, aes(x = jmax, y=lat_ms, fill=links)) +
|
||||
geom_boxplot() +
|
||||
geom_hline(yintercept=800, color = "red", linetype="dashed") +
|
||||
geom_hline(yintercept=400, color = "DarkGreen") +
|
||||
annotate("text", x=8, y=550, label= "high", color="DarkGreen") +
|
||||
annotate("text", x=7.7, y=1000, label= "acceptable", color="red") +
|
||||
coord_cartesian(xlim = c(1, 8)) +
|
||||
scale_fill_grey() +
|
||||
#scale_y_log10() +
|
||||
scale_y_log10() +
|
||||
ylab("latency (ms)") +
|
||||
xlab("max allowed jitter") +
|
||||
theme_classic()
|
||||
|
||||
v1 + ggsave("thunder_configure_ms.png", dpi=300, dev='png', height=5, width=15, units="cm")
|
||||
#v1 + ggsave("thunder_configure_ms.png", dpi=300, dev='png', height=5, width=15, units="cm")
|
||||
|
||||
thunder_rcv <- sqldf("select run,jmax,links,(9900-COUNT(latency)*1.0)/9900 as dlv from thunder_ms group by jmax,links,run")
|
||||
thunder_rcv$jmax <- as.factor(thunder_rcv$jmax)
|
||||
|
@ -30,7 +35,7 @@ v2 <- ggplot(data = thunder_rcv, aes(x = jmax, y=dlv, fill=links)) +
|
|||
xlab("max allowed jitter") +
|
||||
theme_classic()
|
||||
|
||||
thunder_bw <- read.csv("thunder_configure_11_bw.csv")
|
||||
thunder_bw <- read.csv("thunder_configure_12_bw.csv")
|
||||
thunder_bw <- sqldf("select run,jmax,links,udp_sent,udp_rcv,cells_sent,cells_rcv,1.0*cells_sent/udp_sent as sent_ratio,1.0*cells_rcv/udp_rcv as rcv_ratio from thunder_bw where udp_sent > 4000")
|
||||
thunder_bw$jmax <- as.factor(thunder_bw$jmax)
|
||||
thunder_bw$links <- as.factor(thunder_bw$links)
|
||||
|
|
13
scripts/links_parse.py
Executable file
13
scripts/links_parse.py
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import sys,re
|
||||
|
||||
print("run,ts,link_id,status")
|
||||
for line in sys.stdin:
|
||||
res = re.match(r"\[(\d+)\] Blacklisted links: ([_U]+)", line)
|
||||
if not res: continue
|
||||
ts,l = res.groups()
|
||||
l2 = [(i, 'up' if l[i] == "U" else 'down') for i in range(len(l))]
|
||||
for i,v in l2:
|
||||
print(f"{sys.argv[1]},{ts},{i},{v}")
|
||||
|
Loading…
Reference in a new issue