qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lqu...@apache.org
Subject [2/3] qpid-broker-j git commit: QPID-7763: [Java Broker] Improve operational message for queue flow to disk
Date Tue, 02 May 2017 11:40:43 GMT
QPID-7763: [Java Broker] Improve operational message for queue flow to disk


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/92ef4e2f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/92ef4e2f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/92ef4e2f

Branch: refs/heads/master
Commit: 92ef4e2f755528c0f811d79e325f3d570072367e
Parents: 1c20cc3
Author: Lorenz Quack <lquack@apache.org>
Authored: Tue May 2 11:52:01 2017 +0100
Committer: Lorenz Quack <lquack@apache.org>
Committed: Tue May 2 11:58:07 2017 +0100

----------------------------------------------------------------------
 .../server/logging/messages/QueueMessages.java  | 12 +++++-----
 .../messages/Queue_logmessages.properties       |  4 ++--
 .../apache/qpid/server/queue/AbstractQueue.java | 25 ++++++++++++++------
 3 files changed, 26 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/92ef4e2f/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
index 5f0466f..1a00a4d 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/QueueMessages.java
@@ -384,16 +384,16 @@ public class QueueMessages
 
     /**
      * Log a Queue message of the Format:
-     * <pre>QUE-1014 : Message flow to disk active :  Message memory use {0,number,#}
kB exceeds threshold {1,number,#.##} kB</pre>
+     * <pre>QUE-1014 : Message flow to disk active : Queue direct memory : {0,number,#}
kB / {1,number,#.##} kB, Broker direct memory : {2,number,#} kB / {3,number,#.##} kB</pre>
      * Optional values are contained in [square brackets] and are numbered
      * sequentially in the method call.
      *
      */
-    public static LogMessage FLOW_TO_DISK_ACTIVE(Number param1, Number param2)
+    public static LogMessage FLOW_TO_DISK_ACTIVE(Number param1, Number param2, Number param3,
Number param4)
     {
         String rawMessage = _messages.getString("FLOW_TO_DISK_ACTIVE");
 
-        final Object[] messageArguments = {param1, param2};
+        final Object[] messageArguments = {param1, param2, param3, param4};
         // Create a new MessageFormat to ensure thread safety.
         // Sharing a MessageFormat and using applyPattern is not thread safe
         MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -558,16 +558,16 @@ public class QueueMessages
 
     /**
      * Log a Queue message of the Format:
-     * <pre>QUE-1015 : Message flow to disk inactive : Message memory use {0,number,#}
kB within threshold {1,number,#.##} kB</pre>
+     * <pre>QUE-1015 : Message flow to disk inactive : Queue direct memory : {0,number,#}
kB / {1,number,#.##} kB, Broker direct memory : {2,number,#} kB / {3,number,#.##} kB</pre>
      * Optional values are contained in [square brackets] and are numbered
      * sequentially in the method call.
      *
      */
-    public static LogMessage FLOW_TO_DISK_INACTIVE(Number param1, Number param2)
+    public static LogMessage FLOW_TO_DISK_INACTIVE(Number param1, Number param2, Number param3,
Number param4)
     {
         String rawMessage = _messages.getString("FLOW_TO_DISK_INACTIVE");
 
-        final Object[] messageArguments = {param1, param2};
+        final Object[] messageArguments = {param1, param2, param3, param4};
         // Create a new MessageFormat to ensure thread safety.
         // Sharing a MessageFormat and using applyPattern is not thread safe
         MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/92ef4e2f/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
index 4f32bd2..fe2fb29 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
+++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Queue_logmessages.properties
@@ -28,8 +28,8 @@ UNDERFULL = QUE-1004 : Underfull : Size : {0,number} bytes, Resume Capacity
: {1
 DROPPED = QUE-1005 : Dropped : {0,number} messages, Depth : {1,number} bytes, {2,number}
messages, Capacity : {3,number} bytes, {4,number} messages
 
 # use similar number to the broker for similar topic
-FLOW_TO_DISK_ACTIVE = QUE-1014 : Message flow to disk active :  Message memory use {0,number,#}
kB exceeds threshold {1,number,#.##} kB
-FLOW_TO_DISK_INACTIVE = QUE-1015 : Message flow to disk inactive : Message memory use {0,number,#}
kB within threshold {1,number,#.##} kB
+FLOW_TO_DISK_ACTIVE = QUE-1014 : Message flow to disk active : Queue direct memory : {0,number,#}
kB / {1,number,#.##} kB, Broker direct memory : {2,number,#} kB / {3,number,#.##} kB
+FLOW_TO_DISK_INACTIVE = QUE-1015 : Message flow to disk inactive : Queue direct memory :
{0,number,#} kB / {1,number,#.##} kB, Broker direct memory : {2,number,#} kB / {3,number,#.##}
kB
 
 # 0 - operation name
 OPERATION = QUE-1016 : Operation : {0}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/92ef4e2f/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
index 2a46c82..bf5d11b 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
@@ -3353,32 +3353,43 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>>
 
         void reportFlowToDiskStatusIfNecessary(final long estimatedQueueSize, final long
targetQueueSize)
         {
+            final int allocatedDirectMemorySize = QpidByteBuffer.getAllocatedDirectMemorySize();
             if (estimatedQueueSize > targetQueueSize
-                || QpidByteBuffer.getAllocatedDirectMemorySize() > _flowToDiskThreshold)
+                || allocatedDirectMemorySize > _flowToDiskThreshold)
             {
-                reportFlowToDiskActiveIfNecessary(estimatedQueueSize, targetQueueSize);
+                reportFlowToDiskActiveIfNecessary(estimatedQueueSize, targetQueueSize, allocatedDirectMemorySize,
_flowToDiskThreshold);
             }
             else
             {
-                reportFlowToDiskInactiveIfNecessary(estimatedQueueSize, targetQueueSize);
+                reportFlowToDiskInactiveIfNecessary(estimatedQueueSize, targetQueueSize,
allocatedDirectMemorySize, _flowToDiskThreshold);
             }
         }
 
-        private void reportFlowToDiskActiveIfNecessary(long estimatedQueueSize, long targetQueueSize)
+        private void reportFlowToDiskActiveIfNecessary(long estimatedQueueSize,
+                                                       long targetQueueSize,
+                                                       long allocatedDirectMemorySize,
+                                                       long flowToDiskThreshold)
         {
             if (!_lastReportedFlowToDiskStatus.getAndSet(true))
             {
                 getEventLogger().message(_logSubject, QueueMessages.FLOW_TO_DISK_ACTIVE(estimatedQueueSize
/ 1024,
-                                                                                        targetQueueSize
/ 1024));
+                                                                                        targetQueueSize
/ 1024,
+                                                                                        allocatedDirectMemorySize
/ 1024,
+                                                                                        flowToDiskThreshold
/ 1024));
             }
         }
 
-        private void reportFlowToDiskInactiveIfNecessary(long estimatedQueueSize, long targetQueueSize)
+        private void reportFlowToDiskInactiveIfNecessary(long estimatedQueueSize,
+                                                         long targetQueueSize,
+                                                         long allocatedDirectMemorySize,
+                                                         long flowToDiskThreshold)
         {
             if (_lastReportedFlowToDiskStatus.getAndSet(false))
             {
                 getEventLogger().message(_logSubject, QueueMessages.FLOW_TO_DISK_INACTIVE(estimatedQueueSize
/ 1024,
-                                                                                        
 targetQueueSize / 1024));
+                                                                                        
 targetQueueSize / 1024,
+                                                                                        
 allocatedDirectMemorySize / 1024,
+                                                                                        
 flowToDiskThreshold / 1024));
             }
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message