Skip to content
Snippets Groups Projects
Commit 1f129815 authored by nwp2's avatar nwp2
Browse files

data anylasis

parent f515c744
No related branches found
No related tags found
No related merge requests found
import pandas as pd
import numpy as np
data =pd.read_csv("timing_log.csv")
def get_period(df, start, end):
selection = []
for index, row in df.iterrows():
if row.send_time > start and row.send_time <= end:
selection.append(row)
if len(selection) == 1:
start_bandwidth = row.bandwidth
if row.send_time > end:
end_bandwidth = row.bandwidth
break
return (pd.DataFrame(selection), end_bandwidth - start_bandwidth)
def get_stats(df, start, end):
(period, bandwidth) = get_period(data, start, end)
diffs = period.send_time - period.recv_time
th90 = np.percentile(diffs, 90)
med = np.median(diffs)
data_min = np.min(diffs)
data_max = np.max(diffs)
return [th90, med, data_min, data_max, bandwidth]
print(get_stats(data, 1674699826, 1674699826 + 1))
\ No newline at end of file
send_time,recv_time,bandwidth
send_time,recv_time,bandwidth
1674699826.054224,1674699826.053831,82
1674699826.054340,1674699826.0539804,165
1674699826.054224,1674699826.053831,82
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment