10 #ifndef ICE_INSTRUMENTATION_I_H
11 #define ICE_INSTRUMENTATION_I_H
13 #include <Ice/Connection.h>
14 #include <Ice/MetricsObserverI.h>
19 template <
typename T,
typename O>
29 IceMX::ObserverT<T>::attach();
39 IceMX::ObserverT<T>::detach();
47 failed(
const std::string& exceptionName)
49 IceMX::ObserverT<T>::failed(exceptionName);
68 template <
typename ObserverImpl,
typename ObserverMetricsType,
typename ObserverPtrType>
71 const IceMX::MetricsHelperT<ObserverMetricsType>& helper,
74 ICE_INTERNAL_HANDLE<ObserverImpl> obsv =
75 IceMX::ObserverT<T>::template getObserver<ObserverImpl>(mapName, helper);
78 obsv->setDelegate(del);
93 const std::string& name) :
94 IceMX::ObserverFactoryT<
T>(metrics, name)
98 template <
typename ObserverMetricsType,
typename ObserverPtrType>
101 const ObserverPtrType& del)
103 ICE_INTERNAL_HANDLE<T> obsv = IceMX::ObserverFactoryT<T>::getObserver(helper);
106 obsv->setDelegate(del);
112 template <
typename ObserverMetricsType,
typename ObserverPtrType>
115 const ObserverPtrType& del,
116 const ObserverPtrType& old)
118 ICE_INTERNAL_HANDLE<T> obsv = IceMX::ObserverFactoryT<T>::getObserver(helper, old);
121 obsv->setDelegate(del);
128 template <
typename Helper>
132 attrs.add(
"endpoint", &Helper::getEndpoint);
134 attrs.add(
"endpointType", &Helper::getEndpointInfo, &Ice::EndpointInfo::type);
135 attrs.add(
"endpointIsDatagram", &Helper::getEndpointInfo, &Ice::EndpointInfo::datagram);
136 attrs.add(
"endpointIsSecure", &Helper::getEndpointInfo, &Ice::EndpointInfo::secure);
137 attrs.add(
"endpointTimeout", &Helper::getEndpointInfo, &Ice::EndpointInfo::timeout);
138 attrs.add(
"endpointCompress", &Helper::getEndpointInfo, &Ice::EndpointInfo::compress);
140 attrs.add(
"endpointHost", &Helper::getEndpointInfo, &Ice::IPEndpointInfo::host);
141 attrs.add(
"endpointPort", &Helper::getEndpointInfo, &Ice::IPEndpointInfo::port);
144 template <
typename Helper>
148 attrs.add(
"incoming", &Helper::getConnectionInfo, &Ice::ConnectionInfo::incoming);
149 attrs.add(
"adapterName", &Helper::getConnectionInfo, &Ice::ConnectionInfo::adapterName);
150 attrs.add(
"connectionId", &Helper::getConnectionInfo, &Ice::ConnectionInfo::connectionId);
152 attrs.add(
"localHost", &Helper::getConnectionInfo, &Ice::IPConnectionInfo::localAddress);
153 attrs.add(
"localPort", &Helper::getConnectionInfo, &Ice::IPConnectionInfo::localPort);
154 attrs.add(
"remoteHost", &Helper::getConnectionInfo, &Ice::IPConnectionInfo::remoteAddress);
155 attrs.add(
"remotePort", &Helper::getConnectionInfo, &Ice::IPConnectionInfo::remotePort);
157 attrs.add(
"mcastHost", &Helper::getConnectionInfo, &Ice::UDPConnectionInfo::mcastAddress);
158 attrs.add(
"mcastPort", &Helper::getConnectionInfo, &Ice::UDPConnectionInfo::mcastPort);
160 addEndpointAttributes<Helper>(attrs);
165 Ice::Instrumentation::ConnectionObserver>
176 virtual void stateChanged(Ice::Instrumentation::ThreadState,
177 Ice::Instrumentation::ThreadState);
198 Ice::Instrumentation::CollocatedObserver>
206 Ice::Instrumentation::InvocationObserver>
213 virtual Ice::Instrumentation::RemoteObserverPtr
215 const Ice::EndpointPtr&,
219 virtual Ice::Instrumentation::CollocatedObserverPtr
232 virtual Ice::Instrumentation::ObserverPtr
233 getConnectionEstablishmentObserver(
const Ice::EndpointPtr&,
const std::string&);
235 virtual Ice::Instrumentation::ObserverPtr
236 getEndpointLookupObserver(
const Ice::EndpointPtr&);
238 virtual Ice::Instrumentation::ConnectionObserverPtr
239 getConnectionObserver(
const Ice::ConnectionInfoPtr&,
240 const Ice::EndpointPtr&,
241 Ice::Instrumentation::ConnectionState,
242 const Ice::Instrumentation::ConnectionObserverPtr&);
244 virtual Ice::Instrumentation::ThreadObserverPtr
245 getThreadObserver(
const std::string&,
247 Ice::Instrumentation::ThreadState,
248 const Ice::Instrumentation::ThreadObserverPtr&);
250 virtual Ice::Instrumentation::InvocationObserverPtr
251 getInvocationObserver(
const Ice::ObjectPrxPtr&,
const std::string&,
const Ice::Context&);
253 virtual Ice::Instrumentation::DispatchObserverPtr getDispatchObserver(
const Ice::Current&,
256 const IceInternal::MetricsAdminIPtr& getFacet()
const;
261 IceInternal::MetricsAdminIPtr _metrics;
262 const Ice::Instrumentation::CommunicatorObserverPtr _delegate;