add ability to sum a list of interfaces before sorting
This commit is contained in:
parent
35424960cb
commit
54e5538695
1 changed files with 6 additions and 4 deletions
10
plog95.py
10
plog95.py
|
@ -21,7 +21,7 @@ def to_datetime(xd):
|
|||
|
||||
b_or_p=sys.argv[1] # "b" or "p"
|
||||
txrx=int(sys.argv[2]) # 0 for RX 1 for TX
|
||||
iface95=sys.argv[3]
|
||||
iface95_l = sys.argv[3].split(':')
|
||||
|
||||
#=== Thu Jun 28 22:00:08 UTC 2012 ===
|
||||
#Inter-| Receive | Transmit
|
||||
|
@ -62,7 +62,7 @@ for fname in sys.argv[4:]:
|
|||
print(line_i)
|
||||
#raise
|
||||
iface=header.strip(" ")
|
||||
if iface!=iface95: continue
|
||||
if not iface in iface95_l: continue
|
||||
bytes=[int(x) for x in re.findall(r'\w+', data)]
|
||||
d[t_s][iface]={"b":[bytes[0],bytes[8]],"p":[bytes[1],bytes[9]]}
|
||||
|
||||
|
@ -75,7 +75,7 @@ for t in t_l:
|
|||
|
||||
iface_l=iface_d.keys()
|
||||
#iface_l.sort()
|
||||
#print(len(iface_l))
|
||||
#print(iface_l)
|
||||
|
||||
#print "T,",",".join(iface_l)
|
||||
prev={}
|
||||
|
@ -89,6 +89,7 @@ for t in t_l:
|
|||
if tn<=tn0 and t!=t0: continue
|
||||
tn0=tn
|
||||
s="%f"%t
|
||||
tot_mbit_s = 0.0;
|
||||
for i in iface_l:
|
||||
y=0
|
||||
x=None
|
||||
|
@ -101,8 +102,9 @@ for t in t_l:
|
|||
mbit_s=float(y)*8.0/300.0e6
|
||||
#if mbit_s>600.0: print to_datetime(t),mbit_s
|
||||
if mbit_s>10000.0: mbit_s=0.0
|
||||
mb_l.append(mbit_s)
|
||||
tot_mbit_s += mbit_s;
|
||||
prev[i]=x
|
||||
mb_l.append(tot_mbit_s)
|
||||
#print(s)
|
||||
|
||||
mb_l.sort()
|
||||
|
|
Loading…
Add table
Reference in a new issue