This commit is contained in:
limil 2026-01-11 22:10:55 +08:00
parent 10a33ee50d
commit 3fa88b16dd
5 changed files with 201836 additions and 2 deletions

26
run.py Normal file
View File

@ -0,0 +1,26 @@
import json
import matplotlib.pyplot as plt
# 读取 json 文件
with open('real.json', 'r') as f:
data = json.load(f)
intervals = data['intervals']
times = [i['sum']['start'] for i in intervals]
bandwidth = [i['sum']['bits_per_second'] / 1e6 for i in intervals] # 转为 Mbps
loss = [i['sum']['lost_percent'] for i in intervals]
# 绘图
fig, ax1 = plt.subplots()
ax1.set_xlabel('Time (s)')
ax1.set_ylabel('Bandwidth (Mbps)', color='tab:blue')
ax1.plot(times, bandwidth, color='tab:blue', label='Bandwidth')
ax1.set_ylim(0, 25) # 20M带宽建议坐标上限设为25
ax2 = ax1.twinx()
ax2.set_ylabel('Loss (%)', color='tab:red')
ax2.plot(times, loss, color='tab:red', linestyle='--', label='Loss %')
plt.title('iperf3 UDP 20M Pull Test')
plt.show()

View File

@ -1,4 +1,3 @@
nohup: ignoring input
{ {
"start": { "start": {
"connected": [{ "connected": [{

100905
udp/A-S2-B.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
nohup: ignoring input
{ {
"start": { "start": {
"connected": [{ "connected": [{

100905
udp/S2-B.json Normal file

File diff suppressed because it is too large Load Diff