diff options
| author | Ken Giusti <kgiusti@apache.org> | 2012-03-02 20:51:19 +0000 |
|---|---|---|
| committer | Ken Giusti <kgiusti@apache.org> | 2012-03-02 20:51:19 +0000 |
| commit | 3324e0c4e26f04b1471968c947fadb797982ad4a (patch) | |
| tree | 019c5557d43fbdb41e4c208a5211566c1f10fd2c /cpp/src/qpid/broker/Exchange.cpp | |
| parent | 9433e8f920fac38c36293f0659d2adf4d35f4416 (diff) | |
| download | qpid-python-3324e0c4e26f04b1471968c947fadb797982ad4a.tar.gz | |
QPID-3875: allow direct access to per-thread statistics
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1296448 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Exchange.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Exchange.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp index ecaa492903..bf0dac111f 100644 --- a/cpp/src/qpid/broker/Exchange.cpp +++ b/cpp/src/qpid/broker/Exchange.cpp @@ -135,20 +135,23 @@ void Exchange::doRoute(Deliverable& msg, ConstBindingList b) if (mgmtExchange != 0) { - mgmtExchange->inc_msgReceives (); - mgmtExchange->inc_byteReceives (msg.contentSize ()); - if (count == 0) + qmf::org::apache::qpid::broker::Exchange::PerThreadStats *eStats = mgmtExchange->getStatistics(); + uint64_t contentSize = msg.contentSize(); + + eStats->msgReceives += 1; + eStats->byteReceives += contentSize; + if (count == 0) { - //QPID_LOG(warning, "Exchange " << getName() << " could not route message; no matching binding found"); - mgmtExchange->inc_msgDrops (); - mgmtExchange->inc_byteDrops (msg.contentSize ()); - if (brokerMgmtObject) - brokerMgmtObject->inc_discardsNoRoute(); + //QPID_LOG(warning, "Exchange " << getName() << " could not route message; no matching binding found"); + eStats->msgDrops += 1; + eStats->byteDrops += contentSize; + if (brokerMgmtObject) + brokerMgmtObject->inc_discardsNoRoute(); } - else + else { - mgmtExchange->inc_msgRoutes (count); - mgmtExchange->inc_byteRoutes (count * msg.contentSize ()); + eStats->msgRoutes += count; + eStats->byteRoutes += count * contentSize; } } } |
