From 4cb1764f7c6d7ef0825609eae2c4d7ec87b2d61e Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Mon, 2 Mar 2009 01:57:40 +0000 Subject: QPID-1492: make the broker return the current queue depth and maximum queue depth in bytes rather than kilbytes, matching their respective setter methods. Augment the management console's navigation queue selection list to show the appropriate numbers git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@749149 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/server/queue/AMQQueueMBean.java | 13 ++++++------- .../java/org/apache/qpid/server/queue/ManagedQueue.java | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'java/broker/src/main') diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java index 6c44d70847..36da1c4cb1 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java @@ -221,11 +221,12 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, Que _queue.setMaximumMessageCount(value); } + /** + * returns the maximum total size of messages(bytes) in the queue. + */ public Long getMaximumQueueDepth() { - long queueDepthInBytes = _queue.getMaximumQueueDepth(); - - return queueDepthInBytes >> 10; + return _queue.getMaximumQueueDepth(); } public void setMaximumQueueDepth(Long value) @@ -264,13 +265,11 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, Que } /** - * returns the size of messages(KB) in the queue. + * returns the total size of messages(bytes) in the queue. */ public Long getQueueDepth() throws JMException { - long queueBytesSize = _queue.getQueueDepth(); - - return queueBytesSize >> 10; + return _queue.getQueueDepth(); } /** diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java b/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java index 48fae57134..d2cf90b42d 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java @@ -41,7 +41,7 @@ import org.apache.qpid.server.management.MBeanOperationParameter; public interface ManagedQueue { static final String TYPE = "Queue"; - static final int VERSION = 1; + static final int VERSION = 2; /** * Returns the Name of the ManagedQueue. @@ -72,7 +72,7 @@ public interface ManagedQueue * @return * @throws IOException */ - @MBeanAttribute(name="QueueDepth", description="Size of messages(KB) in the queue") + @MBeanAttribute(name="QueueDepth", description="The total size(Bytes) of messages in the queue") Long getQueueDepth() throws IOException, JMException; /** @@ -181,7 +181,7 @@ public interface ManagedQueue * @param value * @throws IOException */ - @MBeanAttribute(name="MaximumQueueDepth", description="The threshold high value(KB) for Queue Depth") + @MBeanAttribute(name="MaximumQueueDepth", description="The threshold high value(Bytes) for Queue Depth") void setMaximumQueueDepth(Long value) throws IOException; //TODO change descriptions -- cgit v1.2.1