| # 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") | ||||
| #transmission_df["goodput"] = transmission_df["payload_size"].rolling("{}s".format(args.interval)).sum() | |||||
| transmission_df["goodput"] = transmission_df["goodput"].apply( | transmission_df["goodput"] = transmission_df["goodput"].apply( | ||||
| lambda x: ((x * 8) / args.interval) / 10**6 | lambda x: ((x * 8) / args.interval) / 10**6 | ||||
| ) | ) | ||||
| transmission_df["goodput_rolling"] = transmission_df["payload_size"].rolling("{}s".format(args.interval)).sum() | |||||
| transmission_df["goodput_rolling"] = transmission_df["goodput_rolling"].apply( | |||||
| lambda x: ((x * 8) / args.interval) / 10 ** 6 | |||||
| ) | |||||
| # set meta values and remove all not needed columns | # set meta values and remove all not needed columns | ||||
| cc_algo = transmission_df["congestion_control"].iloc[0] | cc_algo = transmission_df["congestion_control"].iloc[0] | ||||
| cc_algo = cc_algo.upper() | cc_algo = cc_algo.upper() | ||||
| transmission_direction = transmission_df["direction"].iloc[0] | transmission_direction = transmission_df["direction"].iloc[0] | ||||
| transmission_df = transmission_df.filter(["goodput", "datetime", "ack_rtt"]) | |||||
| transmission_df = transmission_df.filter(["goodput", "datetime", "ack_rtt", "goodput_rolling"]) | |||||
| # read serial csv | # read serial csv | ||||
| serial_df = pd.read_csv(args.serial_file) | serial_df = pd.read_csv(args.serial_file) | ||||
| plt.subplots_adjust() | plt.subplots_adjust() | ||||
| host.plot(transmission_df["goodput"], "-", color="blue", label="goodput") | |||||
| host.plot(transmission_df["goodput_rolling"], "-", color="blue", label="goodput") | |||||
| host.set_xlabel("datetime") | host.set_xlabel("datetime") | ||||
| host.set_ylabel("goodput [Mbps]") | host.set_ylabel("goodput [Mbps]") | ||||