@@ -709,6 +709,12 @@ def __init__(self):
709
709
self .byte_count_table = 0
710
710
self .packet_count_persistent = 0
711
711
self .byte_count_persistent = 0
712
+ self .packet_count_persistent_apply = 0
713
+ self .packet_count_persistent_removed = 0
714
+ self .packet_count_persistent_existing = 0
715
+ self .byte_count_persistent_apply = 0
716
+ self .byte_count_persistent_removed = 0
717
+ self .byte_count_persistent_existing = 0
712
718
self .in_update_cv = Condition ()
713
719
self .in_update = False
714
720
self .new_bucket = True
@@ -744,6 +750,8 @@ def apply(self):
744
750
+ ' Packet is:\n ' + repr (pkt ))
745
751
self .packet_count_persistent += 1
746
752
self .byte_count_persistent += pkt ['payload_len' ]
753
+ self .packet_count_persistent_apply += 1
754
+ self .byte_count_persistent_apply += pkt ['payload_len' ]
747
755
self .bucket .clear ()
748
756
self .log .debug ('In bucket ' + str (id (self )) + ' apply(): ' +
749
757
'persistent packet count is ' +
@@ -881,6 +889,8 @@ def handle_flow_removed(self, match, priority, version, flow_stat):
881
889
packet_count ) ) )
882
890
self .packet_count_persistent += packet_count
883
891
self .byte_count_persistent += byte_count
892
+ self .packet_count_persistent_removed += packet_count
893
+ self .byte_count_persistent_removed += byte_count
884
894
# Note that there is no else action. We just forget
885
895
# that this rule was ever associated with the bucket
886
896
# if we get a "flow removed" message before we got
@@ -1034,6 +1044,10 @@ def stat_in_bucket(flow_stat, s):
1034
1044
' %d' ) % id (self ))
1035
1045
self .packet_count_persistent -= extracted_pkts
1036
1046
self .byte_count_persistent -= extracted_bytes
1047
+ self .packet_count_persistent_existing += (
1048
+ extracted_pkts )
1049
+ self .byte_count_persistent_existing += (
1050
+ extracted_bytes )
1037
1051
self .clear_existing_rule_flag (me )
1038
1052
else :
1039
1053
raise RuntimeError ("weird flow entry" )
@@ -1048,6 +1062,15 @@ def stat_in_bucket(flow_stat, s):
1048
1062
self .packet_count_table + self .packet_count_persistent ) ) )
1049
1063
if not self .outstanding_switches :
1050
1064
self .log .debug ("No outstanding switches; calling callbacks" )
1065
+ self .log .debug ("*** Returning bucket %d counts.\n %s%s%s%s%s%s" % (
1066
+ id (self ),
1067
+ "table counts: %d\n " % self .packet_count_table ,
1068
+ "perst. apply: %d\n " % self .packet_count_persistent_apply ,
1069
+ "perst. remov: %d\n " % self .packet_count_persistent_removed ,
1070
+ "perst. exist: %d\n " % self .packet_count_persistent_existing ,
1071
+ "perst. total: %d\n " % self .packet_count_persistent ,
1072
+ "bucket total: %d\n " % (self .packet_count_table +
1073
+ self .packet_count_persistent )))
1051
1074
self .call_callbacks ([(self .packet_count_table +
1052
1075
self .packet_count_persistent ),
1053
1076
(self .byte_count_table +
0 commit comments