diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-09-13 15:21:23 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-09-13 15:21:23 +0200 |
commit | c8f056b450b84163375579e6613f1d20fe707e05 (patch) | |
tree | 3b28f6ba8136dec7690824805e0e3254ebc712cb /cpp | |
parent | Minor fixes (diff) | |
parent | G++ 4.6 IceStorm compilation fix (diff) | |
download | ice-c8f056b450b84163375579e6613f1d20fe707e05.tar.bz2 ice-c8f056b450b84163375579e6613f1d20fe707e05.tar.xz ice-c8f056b450b84163375579e6613f1d20fe707e05.zip |
Merge remote-tracking branch 'origin/mx' into mx
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/IceStorm/InstrumentationI.cpp | 93 |
1 files changed, 55 insertions, 38 deletions
diff --git a/cpp/src/IceStorm/InstrumentationI.cpp b/cpp/src/IceStorm/InstrumentationI.cpp index a7ad8ef1ae7..4eb719ce6f1 100644 --- a/cpp/src/IceStorm/InstrumentationI.cpp +++ b/cpp/src/IceStorm/InstrumentationI.cpp @@ -217,63 +217,80 @@ TopicObserverI::forwarded() forEach(inc(&TopicMetrics::forwarded)); } +namespace +{ + +struct QueuedUpdate +{ + QueuedUpdate(int count) : count(count) + { + } + + void operator()(const SubscriberMetricsPtr& v) + { + v->queued += count; + } + + int count; +}; + +} void SubscriberObserverI::queued(int count) { - struct Update + forEach(QueuedUpdate(count)); +} + +namespace +{ + +struct OutstandingUpdate +{ + OutstandingUpdate(int count) : count(count) { - Update(int count) : count(count) - { - } + } - void operator()(const SubscriberMetricsPtr& v) - { - v->queued += count; - } + void operator()(const SubscriberMetricsPtr& v) + { + v->queued -= count; + v->outstanding += count; + } + + int count; +}; - int count; - }; - forEach(Update(count)); } void SubscriberObserverI::outstanding(int count) { - struct Update + forEach(OutstandingUpdate(count)); +} + +namespace +{ + +struct DeliveredUpdate +{ + DeliveredUpdate(int count) : count(count) { - Update(int count) : count(count) - { - } + } - void operator()(const SubscriberMetricsPtr& v) - { - v->queued -= count; - v->outstanding += count; - } + void operator()(const SubscriberMetricsPtr& v) + { + v->outstanding -= count; + v->delivered += count; + } + + int count; +}; - int count; - }; - forEach(Update(count)); } void SubscriberObserverI::delivered(int count) { - struct Update - { - Update(int count) : count(count) - { - } - - void operator()(const SubscriberMetricsPtr& v) - { - v->outstanding -= count; - v->delivered += count; - } - - int count; - }; - forEach(Update(count)); + forEach(DeliveredUpdate(count)); } TopicManagerObserverI::TopicManagerObserverI(const MetricsAdminIPtr& metrics) : |