Merge branch 'master' of ssh://git.black-mesa.xyz:434/langspielplatte/measurement-scripts
This commit is contained in:
@@ -14,7 +14,6 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("-l", "--label", help="Label above the plot.")
|
parser.add_argument("-l", "--label", help="Label above the plot.")
|
||||||
parser.add_argument("--no_legend", action="store_false", default=True, help="Do not show legend.")
|
parser.add_argument("--no_legend", action="store_false", default=True, help="Do not show legend.")
|
||||||
parser.add_argument("--save", default=None, help="Location to save pdf file.")
|
parser.add_argument("--save", default=None, help="Location to save pdf file.")
|
||||||
parser.add_argument("--time_offset", default=None, type=int, help="Minutes added to GPS datetime.")
|
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--show_providerinfo",
|
"--show_providerinfo",
|
||||||
|
|||||||
@@ -53,9 +53,8 @@ if __name__ == "__main__":
|
|||||||
transmission_df.index = pd.to_datetime(transmission_df.index)
|
transmission_df.index = pd.to_datetime(transmission_df.index)
|
||||||
transmission_df = transmission_df.sort_index()
|
transmission_df = transmission_df.sort_index()
|
||||||
|
|
||||||
#print("Calculate goodput...")
|
# srtt to [s]
|
||||||
|
transmission_df["srtt"] = transmission_df["srtt"].apply(lambda x: x / 10**6)
|
||||||
#print(transmission_df)
|
|
||||||
|
|
||||||
# key for columns and level for index
|
# key for columns and level for index
|
||||||
transmission_df["goodput"] = transmission_df["payload_size"].groupby(pd.Grouper(level="datetime", freq="{}s".format(args.interval))).transform("sum")
|
transmission_df["goodput"] = transmission_df["payload_size"].groupby(pd.Grouper(level="datetime", freq="{}s".format(args.interval))).transform("sum")
|
||||||
@@ -131,8 +130,8 @@ if __name__ == "__main__":
|
|||||||
ax.axvspan(bounds.min(), bounds.max(), alpha=0.3, color=color_list[c])
|
ax.axvspan(bounds.min(), bounds.max(), alpha=0.3, color=color_list[c])
|
||||||
|
|
||||||
p4, = twin3.plot(transmission_df["snd_cwnd"].dropna(), color="lime", linestyle="dashed", label="cwnd")
|
p4, = twin3.plot(transmission_df["snd_cwnd"].dropna(), color="lime", linestyle="dashed", label="cwnd")
|
||||||
p3, = twin2.plot(transmission_df["ack_rtt"].dropna(), color="red", linestyle="dashdot", label="ACK RTT")
|
p3, = twin2.plot(transmission_df["srtt"].dropna(), color="red", linestyle="dashdot", label="sRTT")
|
||||||
p1, = ax.plot(transmission_df["goodput_rolling"], color="blue", linestyle="solid", label="goodput")
|
p1, = ax.plot(transmission_df["arrival_time"], transmission_df["goodput_rolling"], color="blue", linestyle="solid", label="goodput")
|
||||||
p2, = twin1.plot(transmission_df["downlink_cqi"].dropna(), color="magenta", linestyle="dotted", label="CQI")
|
p2, = twin1.plot(transmission_df["downlink_cqi"].dropna(), color="magenta", linestyle="dotted", label="CQI")
|
||||||
|
|
||||||
ax.set_xlim(transmission_df["index"].min(), transmission_df["index"].max())
|
ax.set_xlim(transmission_df["index"].min(), transmission_df["index"].max())
|
||||||
@@ -144,7 +143,7 @@ if __name__ == "__main__":
|
|||||||
ax.set_xlabel("arrival time")
|
ax.set_xlabel("arrival time")
|
||||||
ax.set_ylabel("Goodput [mbps]")
|
ax.set_ylabel("Goodput [mbps]")
|
||||||
twin1.set_ylabel("CQI")
|
twin1.set_ylabel("CQI")
|
||||||
twin2.set_ylabel("ACK RTT [s]")
|
twin2.set_ylabel("sRTT [s]")
|
||||||
twin3.set_ylabel("cwnd")
|
twin3.set_ylabel("cwnd")
|
||||||
|
|
||||||
ax.yaxis.label.set_color(p1.get_color())
|
ax.yaxis.label.set_color(p1.get_color())
|
||||||
@@ -163,6 +162,30 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if args.save:
|
if args.save:
|
||||||
plt.savefig("{}{}_plot.pdf".format(args.save, csv.replace(".csv", "")))
|
plt.savefig("{}{}_plot.pdf".format(args.save, csv.replace(".csv", "")))
|
||||||
|
|
||||||
|
|
||||||
|
# plot correlations
|
||||||
|
corr_pairs = [
|
||||||
|
["goodput_rolling", "RSRQ"],
|
||||||
|
["goodput_rolling", "RSRP"],
|
||||||
|
["goodput_rolling", "RSSI"],
|
||||||
|
["goodput_rolling", "SINR"],
|
||||||
|
["goodput_rolling", "downlink_cqi"],
|
||||||
|
]
|
||||||
|
|
||||||
|
for pair in corr_pairs:
|
||||||
|
# spearman and pearson
|
||||||
|
sp = transmission_df[pair[0]].corr(transmission_df[pair[1]], method="spearman")
|
||||||
|
pe = transmission_df[pair[0]].corr(transmission_df[pair[1]], method="pearson")
|
||||||
|
title = "{}/{} spearman: {} pearson: {}".format(pair[0], pair[1], round(sp, 4), round(pe, 4))
|
||||||
|
transmission_df.plot.scatter(x=pair[0], y=pair[1], c="DarkBlue", title=title)
|
||||||
|
|
||||||
|
if args.save:
|
||||||
|
plt.savefig("{}{}_corr_{}_and_{}.pdf".format(args.save, csv.replace(".csv", ""), pair[0], pair[1]))
|
||||||
|
|
||||||
|
plt.clf()
|
||||||
|
|
||||||
|
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
||||||
plt.clf()
|
plt.clf()
|
||||||
Reference in New Issue
Block a user