Fixed bug : 205 56/4356/1
authorAnil Vishnoi <avishnoi@in.ibm.com>
Fri, 17 Jan 2014 13:27:23 +0000 (18:57 +0530)
committerAnil Vishnoi <avishnoi@in.ibm.com>
Fri, 17 Jan 2014 13:28:43 +0000 (18:58 +0530)
https://bugs.opendaylight.org/show_bug.cgi?id=205

Change-Id: Ifec5bf5c53b293d70645d534c46615f52d5b1c8e
Signed-off-by: Anil Vishnoi <avishnoi@in.ibm.com>
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java

index 45bc905..bb5dea3 100644 (file)
@@ -177,34 +177,32 @@ public class StatisticsProvider implements AutoCloseable {
 
         for (Node targetNode : targetNodes){
             
-            InstanceIdentifier<Node> targetInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class,targetNode.getKey()).toInstance();
-            NodeRef targetNodeRef = new NodeRef(targetInstanceId);
+            if(targetNode.getAugmentation(FlowCapableNode.class) != null){
+
+                spLogger.info("Send request for stats collection to node : {})",targetNode.getId());
+                
+                InstanceIdentifier<Node> targetInstanceId = InstanceIdentifier.builder(Nodes.class).child(Node.class,targetNode.getKey()).toInstance();
+                
+                NodeRef targetNodeRef = new NodeRef(targetInstanceId);
             
-            try {
+                try{
+                    sendAggregateFlowsStatsFromAllTablesRequest(targetNode.getKey());
                 
-                sendAggregateFlowsStatsFromAllTablesRequest(targetNode.getKey());
+                    sendAllFlowsStatsFromAllTablesRequest(targetNodeRef);
 
-                sendAllFlowsStatsFromAllTablesRequest(targetNodeRef);
-
-                sendAllNodeConnectorsStatisticsRequest(targetNodeRef);
+                    sendAllNodeConnectorsStatisticsRequest(targetNodeRef);
                 
-                sendAllFlowTablesStatisticsRequest(targetNodeRef);
+                    sendAllFlowTablesStatisticsRequest(targetNodeRef);
                 
-                sendAllQueueStatsFromAllNodeConnector (targetNodeRef);
-
-            }catch(Exception e){
-                spLogger.error("Exception occured while sending statistics requests : {}",e);
-            }
-
-            if(targetNode.getAugmentation(FlowCapableNode.class) != null){
-
-                spLogger.info("Send request for stats collection to node : {})",targetNode.getId());
-
-                try{
-                  sendAllGroupStatisticsRequest(targetNodeRef);
-                  sendAllMeterStatisticsRequest(targetNodeRef);
-                  sendGroupDescriptionRequest(targetNodeRef);
-                  sendMeterConfigStatisticsRequest(targetNodeRef);
+                    sendAllQueueStatsFromAllNodeConnector (targetNodeRef);
+
+                    sendAllGroupStatisticsRequest(targetNodeRef);
+                    
+                    sendAllMeterStatisticsRequest(targetNodeRef);
+                    
+                    sendGroupDescriptionRequest(targetNodeRef);
+                    
+                    sendMeterConfigStatisticsRequest(targetNodeRef);
                 }catch(Exception e){
                     spLogger.error("Exception occured while sending statistics requests : {}", e);
                 }