- flow_stat = flow_stat_dict[str(switch_dpid)][0]\r
- if 'bytes' in metric_key:\r
- counter = flow_stat['byte_count']\r
- elif 'packet' in metric_key:\r
- counter = flow_stat['packet_count']\r
+ #flow_stat = flow_stat_dict[str(switch_dpid)][0]\r
+ #if 'bytes' in metric_key:\r
+ # counter = flow_stat['byte_count']\r
+ #elif 'packet' in metric_key:\r
+ # counter = flow_stat['packet_count']\r
+\r
+ counter = 0\r
+ for flow_stat in flow_stat_dict[str(switch_dpid)]:\r
+ if 'bytes' in metric_key:\r
+ counter += flow_stat['byte_count']\r
+ elif 'packet' in metric_key:\r
+ counter += flow_stat['packet_count']\r