コード例 #1
0
        public CommunicatorObserverI(Communicator communicator, Logger logger)
        {
            _metrics     = new MetricsAdminI(communicator, logger);
            _delegate    = communicator.Observer;
            _connections = new ObserverFactoryWithDelegate <ConnectionMetrics, ConnectionObserverI,
                                                            Ice.Instrumentation.ConnectionObserver>(_metrics, "Connection");
            _dispatch = new ObserverFactoryWithDelegate <DispatchMetrics, DispatchObserverI,
                                                         Ice.Instrumentation.DispatchObserver>(_metrics, "Dispatch");
            _invocations = new ObserverFactoryWithDelegate <InvocationMetrics, InvocationObserverI,
                                                            Ice.Instrumentation.InvocationObserver>(_metrics, "Invocation");
            _threads = new ObserverFactoryWithDelegate <ThreadMetrics, ThreadObserverI,
                                                        Ice.Instrumentation.ThreadObserver>(_metrics, "Thread");
            _connects = new ObserverFactoryWithDelegate <Metrics, ObserverWithDelegateI,
                                                         Ice.Instrumentation.Observer>(_metrics, "ConnectionEstablishment");
            _endpointLookups = new ObserverFactoryWithDelegate <Metrics, ObserverWithDelegateI,
                                                                Ice.Instrumentation.Observer>(_metrics, "EndpointLookup");

            try
            {
                Type cl = typeof(InvocationMetrics);
                _invocations.registerSubMap <RemoteMetrics>("Remote", cl.GetField("remotes"));
                _invocations.registerSubMap <CollocatedMetrics>("Collocated", cl.GetField("collocated"));
            }
            catch (System.Exception)
            {
                Debug.Assert(false);
            }
        }
コード例 #2
0
ファイル: InstrumentationI.cs プロジェクト: stick/zeroc-ice
        public CommunicatorObserverI(IceInternal.MetricsAdminI metrics,
                                     Ice.Instrumentation.CommunicatorObserver del)
        {
            _metrics     = metrics;
            _delegate    = del;
            _connections = new ObserverFactoryWithDelegate <ConnectionMetrics, ConnectionObserverI,
                                                            Ice.Instrumentation.ConnectionObserver>(metrics, "Connection");
            _dispatch = new ObserverFactoryWithDelegate <DispatchMetrics, DispatchObserverI,
                                                         Ice.Instrumentation.DispatchObserver>(metrics, "Dispatch");
            _invocations = new ObserverFactoryWithDelegate <InvocationMetrics, InvocationObserverI,
                                                            Ice.Instrumentation.InvocationObserver>(metrics, "Invocation");
            _threads = new ObserverFactoryWithDelegate <ThreadMetrics, ThreadObserverI,
                                                        Ice.Instrumentation.ThreadObserver>(metrics, "Thread");
            _connects = new ObserverFactoryWithDelegate <Metrics, ObserverWithDelegateI,
                                                         Ice.Instrumentation.Observer>(metrics, "ConnectionEstablishment");
            _endpointLookups = new ObserverFactoryWithDelegate <Metrics, ObserverWithDelegateI,
                                                                Ice.Instrumentation.Observer>(metrics, "EndpointLookup");

            try
            {
                _invocations.registerSubMap <RemoteMetrics>("Remote", typeof(InvocationMetrics).GetField("remotes"));
            }
            catch (Exception)
            {
                Debug.Assert(false);
            }
        }