WIP links graph

This commit is contained in:
Quentin 2019-09-16 19:20:38 +02:00
parent 46bf9fbc25
commit f20cfc990d
3 changed files with 42 additions and 4 deletions

View file

@ -52,3 +52,17 @@ v3 <- ggplot(data = thunder_bw, aes(x = jmax, y=sent_ratio, fill=links)) +
t1 <- plot_grid(v1, v2, v3, labels = c('A', 'B', 'C'), ncol=1)
t1 + ggsave("thunder_configure.png", dpi=300, dev='png', height=15, width=15, units="cm")
thunder_links <- read.csv("thunder_configure_12_links.csv")
links_down_at_least_once <- sqldf("select run,xp_time,link_id, COUNT(status) as downcount, SUM(delta) as elapsed from thunder_links where status='down' group by run,link_id,xp_time")
links_down_at_least_once2 <- sqldf("select row_number () OVER (PARTITION BY run ORDER BY elapsed DESC) sorting,run,link_id,downcount,elapsed,xp_time,1.0*elapsed/xp_time down_ratio from links_down_at_least_once")
links_down_at_least_once2$sorting <- as.factor(links_down_at_least_once2$sorting)
ggplot(data = links_down_at_least_once2, aes(x = sorting, y=down_ratio)) +
geom_boxplot() +
#scale_y_log10() +
scale_y_log10(labels = scales::percent) +
scale_fill_grey() +
ylab("down ratio") +
xlab("sorting") +
theme_classic()

View file

@ -2,11 +2,35 @@
import sys,re
acc = []
previous=None
for line in sys.stdin:
res = re.match(r"\[(\d+)\] Blacklisted links: ([_U]+)", line)
if not res: continue
ts,l = res.groups()
ts = int(ts)
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}")
acc.append((ts,l2))
l2 = None
if len(acc) <= 0: sys.exit(0)
ts_first, l_first = acc[0]
ts_last, l_last = acc[len(acc) - 1]
xp_time = ts_last - ts_first
durations = [0 for i,v in l_first]
for j in range(len(acc)):
ts, l = acc[j]
ts_next, l_next = acc[j]
if j+1 < len(acc): ts_next, l_next = acc[j+1]
delta = ts_next - ts
for i,v in l:
durations[i] += delta
i_next,v_next = l_next[i]
will_change = v != v_next or j+1 == len(acc)
print(f"{sys.argv[1]},{ts},{i},{v},{delta},{durations[i]},{will_change},{xp_time}")
if will_change: durations[i] = 0

View file

@ -51,10 +51,10 @@ parse_thunder_bw() {
}
parse_thunder_links() {
echo "run,ts,link_id,status"
echo "run,ts,link_id,status,delta,duration,will_change,xp_time"
get_xp $1 | while read r; do
for i in $(seq 0 1 $2); do
grep -q 'thunder-server 8' out/$r-$i/info.txt && cat out/$r-$i/log/client-donar-stdout.log | ./links_parse.py $r-$i
grep -q 'thunder-client 9900 30 100 8 150' out/$r-$i/info.txt && cat out/$r-$i/log/client-donar-stdout.log | ./links_parse.py $r-$i || true
done
done
}