diff options
| author | Pavel Moravec <pmoravec@apache.org> | 2013-09-06 14:35:15 +0000 |
|---|---|---|
| committer | Pavel Moravec <pmoravec@apache.org> | 2013-09-06 14:35:15 +0000 |
| commit | 144853a664f41feec838deda0717c94178b0244f (patch) | |
| tree | 0c665ea4ab671332e04c30a251fba469592339a8 /qpid/cpp | |
| parent | 8c3a5975c7674515576dd73be2a93d9768604305 (diff) | |
| download | qpid-python-144853a664f41feec838deda0717c94178b0244f.tar.gz | |
QPID-5107: Trace queue&session deletion statistics show zero values for some counters everytime
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1520579 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
| -rw-r--r-- | qpid/cpp/managementgen/qmfgen/templates/Class.cpp | 19 | ||||
| -rw-r--r-- | qpid/cpp/managementgen/qmfgen/templates/Class.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Broker.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/DirectExchange.cpp | 5 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Exchange.cpp | 1 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/FanOutExchange.cpp | 5 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/HeadersExchange.cpp | 5 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Queue.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/SemanticState.cpp | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/SessionState.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/System.cpp | 6 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/System.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/TopicExchange.cpp | 5 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Vhost.cpp | 5 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Vhost.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp_0_10/Connection.cpp | 1 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/legacystore/MessageStoreImpl.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/xml/XmlExchange.cpp | 2 |
18 files changed, 60 insertions, 12 deletions
diff --git a/qpid/cpp/managementgen/qmfgen/templates/Class.cpp b/qpid/cpp/managementgen/qmfgen/templates/Class.cpp index d3033db7e1..bb7bd66fc6 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/Class.cpp +++ b/qpid/cpp/managementgen/qmfgen/templates/Class.cpp @@ -70,6 +70,16 @@ uint8_t /*MGEN:Class.NameCap*/::md5Sum[MD5_LEN] = /*MGEN:Class.NameCap*/::~/*MGEN:Class.NameCap*/ () { +/*MGEN:IF(Class.ExistPerThreadStats)*/ + for (int idx = 0; idx < maxThreads; idx++) + if (perThreadStatsArray[idx] != 0) + delete perThreadStatsArray[idx]; + delete[] perThreadStatsArray; +/*MGEN:ENDIF*/ +} + +void /*MGEN:Class.NameCap*/::debugStats (const std::string& comment) +{ /*MGEN:IF(Root.GenLogs)*/ bool logEnabled; QPID_LOG_TEST_CAT(trace, model, logEnabled); @@ -77,19 +87,14 @@ uint8_t /*MGEN:Class.NameCap*/::md5Sum[MD5_LEN] = { ::qpid::types::Variant::Map map; mapEncodeValues(map, false, true); - QPID_LOG_CAT(trace, model, "Mgmt delete " << className + QPID_LOG_CAT(trace, model, "Mgmt " << comment << ((comment!="")?(" "):("")) << className << ". id:" << getKey() << " Statistics: " << map); } /*MGEN:ENDIF*/ -/*MGEN:IF(Class.ExistPerThreadStats)*/ - for (int idx = 0; idx < maxThreads; idx++) - if (perThreadStatsArray[idx] != 0) - delete perThreadStatsArray[idx]; - delete[] perThreadStatsArray; -/*MGEN:ENDIF*/ } + namespace { const string NAME("name"); const string TYPE("type"); diff --git a/qpid/cpp/managementgen/qmfgen/templates/Class.h b/qpid/cpp/managementgen/qmfgen/templates/Class.h index cd43cef7f4..84fe3df5da 100644 --- a/qpid/cpp/managementgen/qmfgen/templates/Class.h +++ b/qpid/cpp/managementgen/qmfgen/templates/Class.h @@ -118,6 +118,8 @@ namespace qmf { /*MGEN:Root.ExternMethod*/ ~/*MGEN:Class.NameCap*/(); + void debugStats (const std::string& comment); + /*MGEN:Class.SetGeneralReferenceDeclaration*/ /*MGEN:Root.ExternMethod*/ static void registerSelf( diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp index 7c9e82022f..85900f8061 100644 --- a/qpid/cpp/src/qpid/broker/Broker.cpp +++ b/qpid/cpp/src/qpid/broker/Broker.cpp @@ -443,6 +443,8 @@ void Broker::shutdown() { } Broker::~Broker() { + if (mgmtObject != 0) + mgmtObject->debugStats("destroying"); shutdown(); finalize(); // Finalize any plugins. if (config.auth) diff --git a/qpid/cpp/src/qpid/broker/DirectExchange.cpp b/qpid/cpp/src/qpid/broker/DirectExchange.cpp index 773a99d2c9..8ab7b59ed1 100644 --- a/qpid/cpp/src/qpid/broker/DirectExchange.cpp +++ b/qpid/cpp/src/qpid/broker/DirectExchange.cpp @@ -196,6 +196,9 @@ bool DirectExchange::isBound(Queue::shared_ptr queue, const string* const routin return false; } -DirectExchange::~DirectExchange() {} +DirectExchange::~DirectExchange() { + if (mgmtExchange != 0) + mgmtExchange->debugStats("destroying"); +} const std::string DirectExchange::typeName("direct"); diff --git a/qpid/cpp/src/qpid/broker/Exchange.cpp b/qpid/cpp/src/qpid/broker/Exchange.cpp index b9080cdda5..0a25d57cd8 100644 --- a/qpid/cpp/src/qpid/broker/Exchange.cpp +++ b/qpid/cpp/src/qpid/broker/Exchange.cpp @@ -353,6 +353,7 @@ Exchange::Binding::Binding(const string& _key, Queue::shared_ptr _queue, Exchang Exchange::Binding::~Binding () { if (mgmtBinding != 0) { + mgmtBinding->debugStats("destroying"); _qmf::Queue::shared_ptr mo = boost::dynamic_pointer_cast<_qmf::Queue>(queue->GetManagementObject()); if (mo != 0) mo->dec_bindingCount(); diff --git a/qpid/cpp/src/qpid/broker/FanOutExchange.cpp b/qpid/cpp/src/qpid/broker/FanOutExchange.cpp index 43c67af810..20ca06e048 100644 --- a/qpid/cpp/src/qpid/broker/FanOutExchange.cpp +++ b/qpid/cpp/src/qpid/broker/FanOutExchange.cpp @@ -117,6 +117,9 @@ bool FanOutExchange::isBound(Queue::shared_ptr queue, const string* const, const } -FanOutExchange::~FanOutExchange() {} +FanOutExchange::~FanOutExchange() { + if (mgmtExchange != 0) + mgmtExchange->debugStats("destroying"); +} const std::string FanOutExchange::typeName("fanout"); diff --git a/qpid/cpp/src/qpid/broker/HeadersExchange.cpp b/qpid/cpp/src/qpid/broker/HeadersExchange.cpp index 82284feaeb..4e86b09565 100644 --- a/qpid/cpp/src/qpid/broker/HeadersExchange.cpp +++ b/qpid/cpp/src/qpid/broker/HeadersExchange.cpp @@ -339,7 +339,10 @@ void HeadersExchange::getNonFedArgs(const FieldTable* args, FieldTable& nonFedAr } } -HeadersExchange::~HeadersExchange() {} +HeadersExchange::~HeadersExchange() { + if (mgmtExchange != 0) + mgmtExchange->debugStats("destroying"); +} const std::string HeadersExchange::typeName("headers"); diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp index e96ebd3701..5a43df44a4 100644 --- a/qpid/cpp/src/qpid/broker/Queue.cpp +++ b/qpid/cpp/src/qpid/broker/Queue.cpp @@ -223,6 +223,8 @@ Queue::Queue(const string& _name, const QueueSettings& _settings, Queue::~Queue() { + if (mgmtObject != 0) + mgmtObject->debugStats("destroying"); } bool Queue::isLocal(const Message& msg) diff --git a/qpid/cpp/src/qpid/broker/SemanticState.cpp b/qpid/cpp/src/qpid/broker/SemanticState.cpp index 0b4d9f0032..3ba01de004 100644 --- a/qpid/cpp/src/qpid/broker/SemanticState.cpp +++ b/qpid/cpp/src/qpid/broker/SemanticState.cpp @@ -437,8 +437,10 @@ bool SemanticStateConsumerImpl::checkCredit(const Message& msg) SemanticStateConsumerImpl::~SemanticStateConsumerImpl() { - if (mgmtObject != 0) + if (mgmtObject != 0) { + mgmtObject->debugStats("destroying"); mgmtObject->resourceDestroy (); + } } void SemanticState::disable(ConsumerImpl::shared_ptr c) diff --git a/qpid/cpp/src/qpid/broker/SessionState.cpp b/qpid/cpp/src/qpid/broker/SessionState.cpp index 6ee3a693bc..3995eb85dc 100644 --- a/qpid/cpp/src/qpid/broker/SessionState.cpp +++ b/qpid/cpp/src/qpid/broker/SessionState.cpp @@ -98,6 +98,8 @@ void SessionState::rollbackTx() { } SessionState::~SessionState() { + if (mgmtObject != 0) + mgmtObject->debugStats("destroying"); asyncCommandCompleter->cancel(); semanticState.closed(); if (mgmtObject != 0) diff --git a/qpid/cpp/src/qpid/broker/System.cpp b/qpid/cpp/src/qpid/broker/System.cpp index 8d54427fdc..f3b6f96d0c 100644 --- a/qpid/cpp/src/qpid/broker/System.cpp +++ b/qpid/cpp/src/qpid/broker/System.cpp @@ -80,3 +80,9 @@ System::System (string _dataDir, Broker* broker) } } +System::~System () +{ + if (mgmtObject != 0) + mgmtObject->debugStats("destroying"); +} + diff --git a/qpid/cpp/src/qpid/broker/System.h b/qpid/cpp/src/qpid/broker/System.h index 52643fb2d5..4a4af275c4 100644 --- a/qpid/cpp/src/qpid/broker/System.h +++ b/qpid/cpp/src/qpid/broker/System.h @@ -45,6 +45,8 @@ class System : public management::Manageable System (std::string _dataDir, Broker* broker = 0); + ~System (); + management::ManagementObject::shared_ptr GetManagementObject(void) const { return mgmtObject; } diff --git a/qpid/cpp/src/qpid/broker/TopicExchange.cpp b/qpid/cpp/src/qpid/broker/TopicExchange.cpp index d49464b4e1..6a081bf65f 100644 --- a/qpid/cpp/src/qpid/broker/TopicExchange.cpp +++ b/qpid/cpp/src/qpid/broker/TopicExchange.cpp @@ -333,7 +333,10 @@ bool TopicExchange::isBound(Queue::shared_ptr queue, const string* const routing return false; } -TopicExchange::~TopicExchange() {} +TopicExchange::~TopicExchange() { + if (mgmtExchange != 0) + mgmtExchange->debugStats("destroying"); +} const std::string TopicExchange::typeName("topic"); diff --git a/qpid/cpp/src/qpid/broker/Vhost.cpp b/qpid/cpp/src/qpid/broker/Vhost.cpp index e72118b570..8fd88601f5 100644 --- a/qpid/cpp/src/qpid/broker/Vhost.cpp +++ b/qpid/cpp/src/qpid/broker/Vhost.cpp @@ -43,6 +43,11 @@ Vhost::Vhost (qpid::management::Manageable* parentBroker, Broker* broker) } } +Vhost::~Vhost () { + if (mgmtObject != 0) + mgmtObject->debugStats("destroying"); +} + void Vhost::setFederationTag(const std::string& tag) { mgmtObject->set_federationTag(tag); diff --git a/qpid/cpp/src/qpid/broker/Vhost.h b/qpid/cpp/src/qpid/broker/Vhost.h index 599b821870..06a11db8ea 100644 --- a/qpid/cpp/src/qpid/broker/Vhost.h +++ b/qpid/cpp/src/qpid/broker/Vhost.h @@ -40,6 +40,8 @@ class Vhost : public management::Manageable Vhost (management::Manageable* parentBroker, Broker* broker = 0); + ~Vhost (); + management::ManagementObject::shared_ptr GetManagementObject (void) const { return mgmtObject; } void setFederationTag(const std::string& tag); diff --git a/qpid/cpp/src/qpid/broker/amqp_0_10/Connection.cpp b/qpid/cpp/src/qpid/broker/amqp_0_10/Connection.cpp index 6732b66ed4..4cfe988b72 100644 --- a/qpid/cpp/src/qpid/broker/amqp_0_10/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/amqp_0_10/Connection.cpp @@ -174,6 +174,7 @@ void Connection::requestIOProcessing(boost::function0<void> callback) Connection::~Connection() { if (mgmtObject != 0) { + mgmtObject->debugStats("destroying"); if (!link) agent->raiseEvent(_qmf::EventClientDisconnect(mgmtId, getUserId(), mgmtObject->get_remoteProperties())); QPID_LOG_CAT(debug, model, "Delete connection. user:" << getUserId() diff --git a/qpid/cpp/src/qpid/legacystore/MessageStoreImpl.cpp b/qpid/cpp/src/qpid/legacystore/MessageStoreImpl.cpp index c92c9828f4..9c8626a203 100644 --- a/qpid/cpp/src/qpid/legacystore/MessageStoreImpl.cpp +++ b/qpid/cpp/src/qpid/legacystore/MessageStoreImpl.cpp @@ -448,6 +448,8 @@ void MessageStoreImpl::closeDbs() MessageStoreImpl::~MessageStoreImpl() { + if (mgmtObject.get() != 0) + mgmtObject->debugStats("destroying"); finalize(); try { closeDbs(); diff --git a/qpid/cpp/src/qpid/xml/XmlExchange.cpp b/qpid/cpp/src/qpid/xml/XmlExchange.cpp index 29ab859591..3802ec5f7f 100644 --- a/qpid/cpp/src/qpid/xml/XmlExchange.cpp +++ b/qpid/cpp/src/qpid/xml/XmlExchange.cpp @@ -372,6 +372,8 @@ bool XmlExchange::isBound(Queue::shared_ptr queue, const std::string* const bind XmlExchange::~XmlExchange() { + if (mgmtExchange != 0) + mgmtExchange->debugStats("destroying"); bindingsMap.clear(); } |
