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_i