def get_transmission_time_stats(trace, in_trace, out_trace, features):
"""
For the complete trace and the traces only containing incoming and outcoming packets, we extract the following:
- First, second and third quartile
- Total transmission time
"""
in_times = [x[0] for x in in_trace]
out_times = [x[0] for x in out_trace]
total_times = [x[0] for x in trace]
times = [total_times, in_times, out_times]
for time in times:
if len(time) == 0:
features.extend([0, 0, 0, 0])
else:
features.append(np.percentile(time, 25))
features.append(np.percentile(time, 50))
features.append(np.percentile(time, 75))
features.append(np.percentile(time, 100))
评论列表
文章目录