Logging improvements to improve efficiency - specifically in critical path.
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / OFStatisticsManager.java
index 9dc8b3b6aa77f352a80ee58c5e358de0d331f46f..d6100e3fdc499c2bd53eb9eb45c414c70e8517d1 100644 (file)
@@ -176,7 +176,7 @@ public class OFStatisticsManager implements IOFStatisticsManager,
         descriptionListeners = new HashSet<IStatisticsListener>();
 
         configStatsPollIntervals();
-        
+
         // Initialize managed timers
         statisticsTimer = new Timer();
         statisticsTimerTask = new TimerTask() {
@@ -703,8 +703,10 @@ public class OFStatisticsManager implements IOFStatisticsManager,
         ByteBuffer data = ByteBuffer.allocate(length);
         stat.writeTo(data);
         data.rewind();
-        log.trace("getV6ReplyStatistics: Buffer BYTES ARE {}",
-                HexString.toHexString(data.array()));
+        if (log.isTraceEnabled()) {
+            log.trace("getV6ReplyStatistics: Buffer BYTES ARE {}",
+                    HexString.toHexString(data.array()));
+        }
 
         int vendor = data.getInt(); // first 4 bytes is vendor id.
         if (vendor != V6StatsRequest.NICIRA_VENDOR_ID) {