Beispiel #1
0
 public ThreadHelper(string parent, string id, ZeroC.Ice.Instrumentation.ThreadState state)
     : base(_attributes)
 {
     Parent = parent;
     Id     = id;
     _state = state;
 }
Beispiel #2
0
 public void StateChanged(ZeroC.Ice.Instrumentation.ThreadState oldState,
                          ZeroC.Ice.Instrumentation.ThreadState newState)
 {
     _oldState = oldState;
     _newState = newState;
     ForEach(ThreadStateUpdate);
     if (Delegate != null)
     {
         Delegate.StateChanged(oldState, newState);
     }
 }
Beispiel #3
0
 public IThreadObserver?GetThreadObserver(string parent, string id,
                                          ZeroC.Ice.Instrumentation.ThreadState s,
                                          IThreadObserver?oldObsv)
 {
     if (_threads.IsEnabled())
     {
         try
         {
             IThreadObserver?newDelegate = null;
             if (_delegate != null)
             {
                 ThreadObserverI?o = oldObsv is ThreadObserverI ? (ThreadObserverI)oldObsv : null;
                 newDelegate = _delegate.GetThreadObserver(parent, id, s, o != null ? o.GetDelegate() : oldObsv);
             }
             return(_threads.GetObserver(new ThreadHelper(parent, id, s), oldObsv, newDelegate));
         }
         catch (Exception ex)
         {
             _metrics.GetLogger().Error("unexpected exception trying to obtain observer:\n" + ex);
         }
     }
     return(null);
 }