1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
def _handle_flowstats_received (event):
stats = flow_stats_to_list(event.stats)
log.debug("FlowStatsReceived from %s: %s",dpidToStr(event.connection.dpid), stats)
nb_octets= 0
nb_packets = 0
octet = []
#i=0
for f in event.stats:
if f.match.dl_type==0x0800:
nb_octets += f.byte_count
nb_packets += f.packet_count
octet.append(nb_octets)
print(octet)
print "nombre des octets =",nb_octets, "octet"
print "nombre des paquets =",nb_packets, "paquet"
for i in range(len(octet)):
print(i, octet[i])
#
if octet[i+1]-octet[i] > 5:
print ("----") |
Partager