summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-09-13 15:21:23 +0200
committerBenoit Foucher <benoit@zeroc.com>2012-09-13 15:21:23 +0200
commitc8f056b450b84163375579e6613f1d20fe707e05 (patch)
tree3b28f6ba8136dec7690824805e0e3254ebc712cb /cpp
parentMinor fixes (diff)
parentG++ 4.6 IceStorm compilation fix (diff)
downloadice-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.cpp93
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) :