diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-11-20 14:07:11 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-11-20 14:07:11 +0100 |
commit | 716be1c9c28aa36931def96a9a22aded8c0bc525 (patch) | |
tree | bf44d470942125ab0469aa405073ec57a98c05e2 /cpp | |
parent | RPM build fixes (diff) | |
download | ice-716be1c9c28aa36931def96a9a22aded8c0bc525.tar.bz2 ice-716be1c9c28aa36931def96a9a22aded8c0bc525.tar.xz ice-716be1c9c28aa36931def96a9a22aded8c0bc525.zip |
ICE-4965: added Python Ice/metrics demo
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/demo/Glacier2/chat/config.client | 8 | ||||
-rw-r--r-- | cpp/demo/Glacier2/chat/config.glacier2 | 8 | ||||
-rw-r--r-- | cpp/demo/Glacier2/chat/config.server | 7 | ||||
-rw-r--r-- | cpp/demo/Ice/hello/config.client | 8 | ||||
-rw-r--r-- | cpp/demo/Ice/hello/config.server | 8 | ||||
-rw-r--r-- | cpp/demo/Ice/latency/config.client | 7 | ||||
-rw-r--r-- | cpp/demo/Ice/latency/config.server | 8 | ||||
-rw-r--r-- | cpp/demo/Ice/throughput/config.client | 7 | ||||
-rw-r--r-- | cpp/demo/Ice/throughput/config.server | 8 | ||||
-rw-r--r-- | cpp/demo/Ice/value/Value.ice | 2 | ||||
-rw-r--r-- | cpp/demo/IceStorm/clock/config.pub | 8 | ||||
-rw-r--r-- | cpp/demo/IceStorm/clock/config.service | 8 | ||||
-rw-r--r-- | cpp/demo/IceStorm/clock/config.sub | 8 | ||||
-rw-r--r-- | cpp/include/Ice/MetricsObserverI.h | 14 | ||||
-rw-r--r-- | cpp/src/Ice/InstrumentationI.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/metrics/AllTests.cpp | 5 |
16 files changed, 107 insertions, 9 deletions
diff --git a/cpp/demo/Glacier2/chat/config.client b/cpp/demo/Glacier2/chat/config.client index e7f3a9caeeb..239f720b084 100644 --- a/cpp/demo/Glacier2/chat/config.client +++ b/cpp/demo/Glacier2/chat/config.client @@ -62,3 +62,11 @@ IceSSL.DefaultDir=../../../../certs IceSSL.CertAuthFile=cacert.pem IceSSL.CertFile=c_rsa1024_pub.pem IceSSL.KeyFile=c_rsa1024_priv.pem + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10003 +Ice.Admin.InstanceName=client +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Glacier2/chat/config.glacier2 b/cpp/demo/Glacier2/chat/config.glacier2 index be4dc83684a..6a2a5c142e5 100644 --- a/cpp/demo/Glacier2/chat/config.glacier2 +++ b/cpp/demo/Glacier2/chat/config.glacier2 @@ -59,3 +59,11 @@ IceSSL.KeyFile=s_rsa1024_priv.pem # client certificates (such as a Metro Style App client for example). # #IceSSL.VerifyPeer=0 + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10004 +Ice.Admin.InstanceName=glacier2router +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Glacier2/chat/config.server b/cpp/demo/Glacier2/chat/config.server index 6bde7de7778..0fe901738ec 100644 --- a/cpp/demo/Glacier2/chat/config.server +++ b/cpp/demo/Glacier2/chat/config.server @@ -29,3 +29,10 @@ Ice.Warn.Connections=1 # #Ice.Trace.Protocol=1 +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10002 +Ice.Admin.InstanceName=server +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/hello/config.client b/cpp/demo/Ice/hello/config.client index c6fb2622b1b..c71a06aa5a0 100644 --- a/cpp/demo/Ice/hello/config.client +++ b/cpp/demo/Ice/hello/config.client @@ -43,3 +43,11 @@ IceSSL.DefaultDir=../../../../certs IceSSL.CertAuthFile=cacert.pem IceSSL.CertFile=c_rsa1024_pub.pem IceSSL.KeyFile=c_rsa1024_priv.pem + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10003 +Ice.Admin.InstanceName=client +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/hello/config.server b/cpp/demo/Ice/hello/config.server index 183b5691acf..b6a2a768c96 100644 --- a/cpp/demo/Ice/hello/config.server +++ b/cpp/demo/Ice/hello/config.server @@ -51,3 +51,11 @@ IceSSL.KeyFile=s_rsa1024_priv.pem # client certificates (such as a Metro Style App client for example). # #IceSSL.VerifyPeer=0 + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10002 +Ice.Admin.InstanceName=server +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/latency/config.client b/cpp/demo/Ice/latency/config.client index 370ce72c0c6..fe9321872da 100644 --- a/cpp/demo/Ice/latency/config.client +++ b/cpp/demo/Ice/latency/config.client @@ -18,3 +18,10 @@ IceSSL.CertAuthFile=cacert.pem IceSSL.CertFile=c_rsa1024_pub.pem IceSSL.KeyFile=c_rsa1024_priv.pem +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10003 +Ice.Admin.InstanceName=client +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/latency/config.server b/cpp/demo/Ice/latency/config.server index 59f42cde9a0..f4855c64b94 100644 --- a/cpp/demo/Ice/latency/config.server +++ b/cpp/demo/Ice/latency/config.server @@ -17,3 +17,11 @@ IceSSL.DefaultDir=../../../../certs IceSSL.CertAuthFile=cacert.pem IceSSL.CertFile=s_rsa1024_pub.pem IceSSL.KeyFile=s_rsa1024_priv.pem + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10002 +Ice.Admin.InstanceName=server +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/throughput/config.client b/cpp/demo/Ice/throughput/config.client index 413d483d64d..1e271e29c88 100644 --- a/cpp/demo/Ice/throughput/config.client +++ b/cpp/demo/Ice/throughput/config.client @@ -18,3 +18,10 @@ IceSSL.CertAuthFile=cacert.pem IceSSL.CertFile=c_rsa1024_pub.pem IceSSL.KeyFile=c_rsa1024_priv.pem +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10003 +Ice.Admin.InstanceName=client +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/throughput/config.server b/cpp/demo/Ice/throughput/config.server index 82f80f7ca67..86b3decf6dd 100644 --- a/cpp/demo/Ice/throughput/config.server +++ b/cpp/demo/Ice/throughput/config.server @@ -18,3 +18,11 @@ IceSSL.DefaultDir=../../../../certs IceSSL.CertAuthFile=cacert.pem IceSSL.CertFile=s_rsa1024_pub.pem IceSSL.KeyFile=s_rsa1024_priv.pem + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10002 +Ice.Admin.InstanceName=server +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/Ice/value/Value.ice b/cpp/demo/Ice/value/Value.ice index f275e7cdaa2..e925acf8c88 100644 --- a/cpp/demo/Ice/value/Value.ice +++ b/cpp/demo/Ice/value/Value.ice @@ -23,7 +23,7 @@ class Printer void printBackwards(); }; -["cpp:virtual"]class DerivedPrinter extends Printer +["cpp:virtual"] class DerivedPrinter extends Printer { string derivedMessage; void printUppercase(); diff --git a/cpp/demo/IceStorm/clock/config.pub b/cpp/demo/IceStorm/clock/config.pub index e429d59ee95..9d0dd727ce7 100644 --- a/cpp/demo/IceStorm/clock/config.pub +++ b/cpp/demo/IceStorm/clock/config.pub @@ -12,3 +12,11 @@ TopicManager.Proxy=DemoIceStorm/TopicManager:default -h localhost -p 10000 # 3 = like 2, but also trace data transfer # #Ice.Trace.Network=1 + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10003 +Ice.Admin.InstanceName=publisher +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/IceStorm/clock/config.service b/cpp/demo/IceStorm/clock/config.service index be8f233940b..c6a49e3ad38 100644 --- a/cpp/demo/IceStorm/clock/config.service +++ b/cpp/demo/IceStorm/clock/config.service @@ -73,3 +73,11 @@ IceStorm.Flush.Timeout=2000 # database environment for the IceStorm service. # Freeze.DbEnv.IceStorm.DbHome=db + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10004 +Ice.Admin.InstanceName=icestorm +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/demo/IceStorm/clock/config.sub b/cpp/demo/IceStorm/clock/config.sub index 7a6018b9eb7..cd856df73b4 100644 --- a/cpp/demo/IceStorm/clock/config.sub +++ b/cpp/demo/IceStorm/clock/config.sub @@ -19,3 +19,11 @@ TopicManager.Proxy=DemoIceStorm/TopicManager:default -h localhost -p 10000 # 3 = like 2, but also trace data transfer # #Ice.Trace.Network=1 + +# +# IceMX configuration. +# +#Ice.Admin.Endpoints=tcp -h localhost -p 10002 +Ice.Admin.InstanceName=subscriber +IceMX.Metrics.Debug.GroupBy=id +IceMX.Metrics.ByParent.GroupBy=parent diff --git a/cpp/include/Ice/MetricsObserverI.h b/cpp/include/Ice/MetricsObserverI.h index 50734e813ac..b1ede7cc949 100644 --- a/cpp/include/Ice/MetricsObserverI.h +++ b/cpp/include/Ice/MetricsObserverI.h @@ -305,20 +305,23 @@ public: typedef typename IceInternal::MetricsMapT<MetricsType>::EntryTPtr EntryPtrType; typedef std::vector<EntryPtrType> EntrySeqType; - ObserverT() + ObserverT() : _previousDelay(0) { } virtual void attach() { - _watch.start(); + if(!_watch.isStarted()) + { + _watch.start(); + } } virtual void detach() { - ::Ice::Long lifetime = _watch.stop(); + ::Ice::Long lifetime = _previousDelay + _watch.stop(); for(typename EntrySeqType::const_iterator p = _objects.begin(); p != _objects.end(); ++p) { (*p)->detach(lifetime); @@ -353,6 +356,8 @@ public: return; } + _previousDelay = previous->_previousDelay + previous->_watch.delay(); + // // Detach entries from previous observer which are no longer // attached to this new observer. @@ -361,7 +366,7 @@ public: { if(find(_objects.begin(), _objects.end(), *p) == _objects.end()) { - (*p)->detach(_watch.delay()); + (*p)->detach(_previousDelay); } } } @@ -406,6 +411,7 @@ private: EntrySeqType _objects; IceUtilInternal::StopWatch _watch; + long _previousDelay; }; template<typename ObserverImplType> diff --git a/cpp/src/Ice/InstrumentationI.cpp b/cpp/src/Ice/InstrumentationI.cpp index 0790bd34689..c9f17cdd662 100644 --- a/cpp/src/Ice/InstrumentationI.cpp +++ b/cpp/src/Ice/InstrumentationI.cpp @@ -406,7 +406,7 @@ public: { try { - os << _proxy << " [" << _operation << ']'; + os << _proxy->ice_endpoints(Ice::EndpointSeq()) << " [" << _operation << ']'; } catch(const FixedProxyException&) { diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp index 3c1bfa42822..a368ddea1c3 100644 --- a/cpp/test/Ice/metrics/AllTests.cpp +++ b/cpp/test/Ice/metrics/AllTests.cpp @@ -992,15 +992,14 @@ allTests(const Ice::CommunicatorPtr& communicator) checkFailure(clientMetrics, "Invocation", im1->id, "Ice::ConnectionLostException", 3); testAttribute(clientMetrics, clientProps, update, "Invocation", "parent", "Communicator", op); - testAttribute(clientMetrics, clientProps, update, "Invocation", "id", - "metrics -t -e 1.1:tcp -h 127.0.0.1 -p 12010 [op]", op); + testAttribute(clientMetrics, clientProps, update, "Invocation", "id", "metrics -t -e 1.1 [op]", op); testAttribute(clientMetrics, clientProps, update, "Invocation", "operation", "op", op); testAttribute(clientMetrics, clientProps, update, "Invocation", "identity", "metrics", op); testAttribute(clientMetrics, clientProps, update, "Invocation", "facet", "", op); testAttribute(clientMetrics, clientProps, update, "Invocation", "encoding", "1.1", op); testAttribute(clientMetrics, clientProps, update, "Invocation", "mode", "twoway", op); - testAttribute(clientMetrics, clientProps, update, "Invocation", "proxy", + testAttribute(clientMetrics, clientProps, update, "Invocation", "proxy", "metrics -t -e 1.1:tcp -h 127.0.0.1 -p 12010", op); testAttribute(clientMetrics, clientProps, update, "Invocation", "context.entry1", "test", op); |