- plt.figure(1)
-
- cwndx = listx(d["cwnd"])
- cwndy = listy(d["cwnd"])
- congx = listx(d["congestion"])
- congy = listy(d["congestion"])
- rcvrdx = listx(d["recovered"])
- rcvrdy = listy(d["recovered"])
- rxttx = listx(d["rxtTimeout"])
- rxtty = listy(d["rxtTimeout"])
-
- # cwnd/ssthresh/cc events
- plt.subplot(311)
- plt.title("cwnd/ssthresh")
- pcwnd = plt.plot(cwndx, cwndy, 'r')
- psst = plt.plot(cwndx, d["ssthresh"], 'y-')
- pcong = plt.plot(congx, congy,'yo')
- precov = plt.plot(rcvrdx, rcvrdy,'co')
- prxtt = plt.plot(rxttx, rxtty,'mo')
-
- marker1 = Line2D(range(1), range(1), color="r")
- marker2 = Line2D(range(1), range(1), color="y")
- marker3 = Line2D(range(1), range(1), color="w", marker="o", markerfacecolor="y")
- marker4 = Line2D(range(1), range(1), color="w", marker="o", markerfacecolor="c")
- marker5 = Line2D(range(1), range(1), color="w", marker="o", markerfacecolor="m")
- plt.legend((marker1, marker2, marker3, marker4, marker5),
- ('cwnd', 'ssthresh', 'congestion', 'recovered', 'rxt-timeout'),
- loc=4)
- axes = plt.gca()
- axes.set_ylim([-20e4, max(cwndy) + 20e4])
-
- # snd variables
- plt.subplot(312)
- plt.title("cc variables")
- plt.plot(cwndx, d["space"], 'g-', markersize=1)
- plt.plot(cwndx, d["flight"], 'b-', markersize=1)
- plt.plot(cwndx, d["sacked"], 'm:', markersize=1)
- plt.plot(cwndx, d["lost"], 'y:', markersize=1)
- plt.plot(cwndx, d["cc-space"], 'k:', markersize=1)
- plt.plot(cwndx, cwndy, 'ro', markersize=2)
-
- plt.plot(congx, congy, 'y^', markersize=10, markerfacecolor="y")
- plt.plot(rcvrdx, rcvrdy, 'c^', markersize=10, markerfacecolor="c")
- plt.plot(rxttx, rxtty, 'm^', markersize=10, markerfacecolor="m")
-
- #plt.plot(cwndx, d["snd_wnd"], 'ko', markersize=1)
- plt.legend(("snd-space", "flight", "sacked", "lost", "cc-space", "cwnd",
- "congestion", "recovered", "rxt-timeout"),
- loc=1)
-
- # rto/srrt/rttvar
- plt.subplot(313)
- plt.title("rtt")
- plt.plot(cwndx, d["srtt"], 'g-')
- plt.plot(cwndx, [x/1000 for x in d["mrtt-us"]], 'r-')
- plt.plot(cwndx, d["rttvar"], 'b-')
- plt.legend(["srtt", "mrtt-us", "rttvar"])
- axes = plt.gca()
- #plt.plot(cwndx, rto, 'r-')
- #axes.set_ylim([0, int(max(rto[2:len(rto)])) + 50])
-
- # show
- plt.show()
-
-def find_pattern(file_path,session_idx):
+ plt.figure(1)
+
+ cwndx = listx(d["cwnd"])
+ cwndy = listy(d["cwnd"])
+ congx = listx(d["congestion"])
+ congy = listy(d["congestion"])
+ rcvrdx = listx(d["recovered"])
+ rcvrdy = listy(d["recovered"])
+ rxttx = listx(d["rxtTimeout"])
+ rxtty = listy(d["rxtTimeout"])
+
+ # cwnd/ssthresh/cc events
+ plt.subplot(311)
+ plt.title("cwnd/ssthresh")
+ pcwnd = plt.plot(cwndx, cwndy, "r")
+ psst = plt.plot(cwndx, d["ssthresh"], "y-")
+ pcong = plt.plot(congx, congy, "yo")
+ precov = plt.plot(rcvrdx, rcvrdy, "co")
+ prxtt = plt.plot(rxttx, rxtty, "mo")
+
+ marker1 = Line2D(range(1), range(1), color="r")
+ marker2 = Line2D(range(1), range(1), color="y")
+ marker3 = Line2D(range(1), range(1), color="w", marker="o", markerfacecolor="y")
+ marker4 = Line2D(range(1), range(1), color="w", marker="o", markerfacecolor="c")
+ marker5 = Line2D(range(1), range(1), color="w", marker="o", markerfacecolor="m")
+ plt.legend(
+ (marker1, marker2, marker3, marker4, marker5),
+ ("cwnd", "ssthresh", "congestion", "recovered", "rxt-timeout"),
+ loc=4,
+ )
+ axes = plt.gca()
+ axes.set_ylim([-20e4, max(cwndy) + 20e4])
+
+ # snd variables
+ plt.subplot(312)
+ plt.title("cc variables")
+ plt.plot(cwndx, d["space"], "g-", markersize=1)
+ plt.plot(cwndx, d["flight"], "b-", markersize=1)
+ plt.plot(cwndx, d["sacked"], "m:", markersize=1)
+ plt.plot(cwndx, d["lost"], "y:", markersize=1)
+ plt.plot(cwndx, d["cc-space"], "k:", markersize=1)
+ plt.plot(cwndx, cwndy, "ro", markersize=2)
+
+ plt.plot(congx, congy, "y^", markersize=10, markerfacecolor="y")
+ plt.plot(rcvrdx, rcvrdy, "c^", markersize=10, markerfacecolor="c")
+ plt.plot(rxttx, rxtty, "m^", markersize=10, markerfacecolor="m")
+
+ # plt.plot(cwndx, d["snd_wnd"], 'ko', markersize=1)
+ plt.legend(
+ (
+ "snd-space",
+ "flight",
+ "sacked",
+ "lost",
+ "cc-space",
+ "cwnd",
+ "congestion",
+ "recovered",
+ "rxt-timeout",
+ ),
+ loc=1,
+ )
+
+ # rto/srrt/rttvar
+ plt.subplot(313)
+ plt.title("rtt")
+ plt.plot(cwndx, d["srtt"], "g-")
+ plt.plot(cwndx, [x / 1000 for x in d["mrtt-us"]], "r-")
+ plt.plot(cwndx, d["rttvar"], "b-")
+ plt.legend(["srtt", "mrtt-us", "rttvar"])
+ axes = plt.gca()
+ # plt.plot(cwndx, rto, 'r-')
+ # axes.set_ylim([0, int(max(rto[2:len(rto)])) + 50])
+
+ # show
+ plt.show()
+
+
+def find_pattern(file_path, session_idx):