added spying on overall OFJ backpressure on/off operations 88/20788/1
authorMartin Bobak <mbobak@cisco.com>
Wed, 20 May 2015 09:44:49 +0000 (11:44 +0200)
committerMartin Bobak <mbobak@cisco.com>
Wed, 20 May 2015 10:05:27 +0000 (12:05 +0200)
Change-Id: Icadae7c2a2842dbaade28259e8e823c838561b91
Signed-off-by: Martin Bobak <mbobak@cisco.com>
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/statistics/ofpspecific/MessageSpy.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java

index e8a102263c35ee4d2c1025389b34799a17167ed1..f9f35a50fc612cca21c19d6f9fe530fe8859ec0e 100644 (file)
@@ -81,7 +81,16 @@ public interface MessageSpy extends Runnable {
         /**
          * TEMPORARY STATISTIC VALUE
          */
-        REQUEST_STACK_FREED
+        REQUEST_STACK_FREED,
+        /**
+         * stop receiving data from device - turned on
+         */
+        OFJ_BACKPRESSURE_ON,
+        /**
+         * stop receiving data from device - turned off
+         */
+        OFJ_BACKPRESSURE_OFF
+
 
     }
 
@@ -90,4 +99,5 @@ public interface MessageSpy extends Runnable {
      * @param statGroup
      */
     void spyMessage(Class<?> message, STATISTIC_GROUP statGroup);
+    
 }
index ac003da9416c7c722ce255d0e09a9fbfed4a7aa6..f75a58e576afbeab5a8fb29796b6f67926e3b83e 100644 (file)
@@ -295,6 +295,7 @@ public class DeviceContextImpl implements DeviceContext {
             synchronized (throttlingLock) {
                 if (outstandingNotificationsAmount > 1 && !filteringPacketIn) {
                     connectionAdapter.setPacketInFiltering(true);
+                    messageSpy.spyMessage(DeviceContext.class, MessageSpy.STATISTIC_GROUP.OFJ_BACKPRESSURE_ON);
                     filteringPacketIn = true;
                     filteringHighWaterMark = outstandingNotificationsAmount;
                     LOG.debug("PacketIn filtering on: {}, watermark: {}", connectionAdapter.getRemoteAddress(), outstandingNotificationsAmount);
@@ -323,6 +324,8 @@ public class DeviceContextImpl implements DeviceContext {
                             outstandingNotificationsAmount -= 1;
                             if (outstandingNotificationsAmount == 0 && filteringPacketIn) {
                                 connectionAdapter.setPacketInFiltering(false);
+                                messageSpy.spyMessage(DeviceContext.class, MessageSpy.STATISTIC_GROUP.OFJ_BACKPRESSURE_OFF);
+
                                 filteringPacketIn = false;
                                 LOG.debug("PacketIn filtering off: {}, outstanding: {}", connectionAdapter.getRemoteAddress(), outstandingNotificationsAmount);
                             }