Stats Improvement
diff --git a/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java b/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java
index 4f45463..ce2221e 100644
--- a/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java
+++ b/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java
@@ -20,6 +20,7 @@
import java.util.HashMap;
import org.projectfloodlight.openflow.protocol.OFStatsType;
+import org.projectfloodlight.openflow.util.HexString;
import org.restlet.resource.Get;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,14 +42,24 @@
String switchId = (String) getRequestAttributes().get("switchId");
String statType = (String) getRequestAttributes().get("statType");
+ String tableType = null;
+ if(getRequestAttributes().containsKey("tableType")){
+ tableType = (String) getRequestAttributes().get("tableType");
+ }
if (statType.equals("port")) {
values = getSwitchStatistics(switchId, OFStatsType.PORT);
} else if (statType.equals("queue")) {
values = getSwitchStatistics(switchId, OFStatsType.QUEUE);
} else if (statType.equals("flow")) {
- values = getSwitchStatistics(switchId, OFStatsType.FLOW);
- } else if (statType.equals("aggregate")) {
+ if (tableType != null){
+ values = getSwitchStatisticsForTable(HexString.toLong(switchId), OFStatsType.FLOW, tableType);
+ }
+ else{
+ values = getSwitchStatistics(switchId, OFStatsType.FLOW);
+ }
+ }
+ else if (statType.equals("aggregate")) {
values = getSwitchStatistics(switchId, OFStatsType.AGGREGATE);
} else if (statType.equals("desc")) {
values = getSwitchStatistics(switchId, OFStatsType.DESC);