summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2011-03-02 19:02:00 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2011-03-02 19:02:00 +0000
commitbfc890b6dbfc25211dfd9639f76df46e47e0e129 (patch)
tree4447ff369453cda6dd815a66d662e2dbb79ea2b1 /qpid/cpp/src
parent872b548667e23d49a8ffacfd272a38f44a19321c (diff)
downloadqpid-python-bfc890b6dbfc25211dfd9639f76df46e47e0e129.tar.gz
QPID-3081: add statistic for queue flow control transitions
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1076329 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp4
-rw-r--r--qpid/cpp/src/tests/queue_flow_limit_tests.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp b/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
index a99c9de7df..21c7a2a737 100644
--- a/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
+++ b/qpid/cpp/src/qpid/broker/QueueFlowLimit.cpp
@@ -138,8 +138,10 @@ void QueueFlowLimit::enqueued(const QueuedMessage& msg)
flowStopped = true;
QPID_LOG(info, "Queue \"" << queueName << "\": has reached " << flowStopSize << " enqueued bytes. Producer flow control activated." );
}
- if (flowStopped && queueMgmtObj)
+ if (flowStopped && queueMgmtObj) {
queueMgmtObj->set_flowStopped(true);
+ queueMgmtObj->inc_flowStoppedCount();
+ }
}
/** @todo KAG: - REMOVE ONCE STABLE */
diff --git a/qpid/cpp/src/tests/queue_flow_limit_tests.py b/qpid/cpp/src/tests/queue_flow_limit_tests.py
index ac62dcdd1e..bdd2a21b78 100644
--- a/qpid/cpp/src/tests/queue_flow_limit_tests.py
+++ b/qpid/cpp/src/tests/queue_flow_limit_tests.py
@@ -137,12 +137,12 @@ class QueueFlowLimitTests(TestBase010):
"""
self.startQmf();
oid = self._create_queue("test-q", stop_count=373, resume_count=229)
+ self.assertEqual(self.qmf.getObjects(_objectId=oid)[0].flowStoppedCount, 0)
sndr1 = self._start_qpid_send("test-q", count=1213, content="XXX", capacity=50);
sndr2 = self._start_qpid_send("test-q", count=797, content="Y", capacity=13);
sndr3 = self._start_qpid_send("test-q", count=331, content="ZZZZZ", capacity=149);
totalMsgs = 1213 + 797 + 331
-
# wait until flow control is active
count = 0
@@ -180,6 +180,7 @@ class QueueFlowLimitTests(TestBase010):
self.assertEqual(count, totalMsgs)
self.failIf(self.qmf.getObjects(_objectId=oid)[0].flowStopped)
+ self.failUnless(self.qmf.getObjects(_objectId=oid)[0].flowStoppedCount)
self._delete_queue("test-q")