python matplotlib 实时绘制iperf吞吐量数据
效果展示
单条流

多条流

python 代码
import sys
import matplotlib.pyplot as plt
import numpy as np
import time
import thread
from matplotlib import animation
colors = ["red",
"green",
"blue",
"rosybrown",
"black"]
markers = ["x",
"o",
"v",
"s",
"*",
]
tp_pair = []
pair_idx = []
pair_cnt = 0
filter_str = "Mbits"
fig = plt.figure(figsize=(18, 8), facecolor="white")
plt.grid(True)
plt.ion()
class tp_item(object):
idx = 0
ts = 0.0
mb = 0.0
bw = 0
def tp_init(self, line):
line = line.strip()
line = line.split()
self.idx = int(line[1].replace("]", ""))
self.ts = float(line[2].split("-

本文介绍了一种使用Python、Matplotlib和Iperf实时绘制网络吞吐量数据的方法。通过读取Iperf生成的数据文件,该程序能够动态更新图表,显示多条流的吞吐量变化,适用于网络性能测试的实时监控。
最低0.47元/天 解锁文章
2511

被折叠的 条评论
为什么被折叠?



