예제 #1
0
        /// <summary>
        /// Compare the latest Connectivity Matrix from the Diagnostic Service against the known set of participants.
        /// Raise events when changes are detected.
        /// </summary>
        /// <param name="callingThread"></param>
        private void CheckMatrix(DiagnosticMonitorThread callingThread)
        {
            if (!callingThread.Equals(m_Thread))
            {
                return;
            }

            List <DiagnosticUpdateEventArgs> events = new List <DiagnosticUpdateEventArgs>();

            lock (this) {
                //Check for senders (rows) in the matrix that don't correspond to known participants.
                //If the missing participants list changed since last time we checked, queue events.
                CheckMissingParticipants(callingThread.ConnectivityMatrix, events);

                //Look for cells in the matrix with throughput metric above the threshold.
                //If this list changed since last time we checked, queue events.
                CheckThroughput(callingThread.ConnectivityMatrix, events);
            }

            //Raise events
            if (DiagnosticUpdate != null)
            {
                foreach (DiagnosticUpdateEventArgs args in events)
                {
                    DiagnosticUpdate(args);
                }
            }
        }
예제 #2
0
 public void Start()
 {
     if (m_Thread != null)
     {
         Stop();
     }
     m_Thread = new DiagnosticMonitorThread(m_Service, this);
 }
예제 #3
0
 public void Stop()
 {
     if (m_Thread != null)
     {
         m_Thread.Stop();
         m_Thread = null;
     }
 }
예제 #4
0
 public void Stop() {
     if (m_Thread != null) {
         m_Thread.Stop();
         m_Thread = null;
     }
 }
예제 #5
0
 public void Start() {
     if (m_Thread != null) {
         Stop();
     }
     m_Thread = new DiagnosticMonitorThread(m_Service,this);
 }
예제 #6
0
        /// <summary>
        /// Compare the latest Connectivity Matrix from the Diagnostic Service against the known set of participants.
        /// Raise events when changes are detected.
        /// </summary>
        /// <param name="callingThread"></param>
        private void CheckMatrix(DiagnosticMonitorThread callingThread) {
            if (!callingThread.Equals(m_Thread)) {
                return;
            }

            List<DiagnosticUpdateEventArgs> events = new List<DiagnosticUpdateEventArgs>();

            lock (this) {
                //Check for senders (rows) in the matrix that don't correspond to known participants.
                //If the missing participants list changed since last time we checked, queue events.
                CheckMissingParticipants(callingThread.ConnectivityMatrix, events);

                //Look for cells in the matrix with throughput metric above the threshold.
                //If this list changed since last time we checked, queue events.
                CheckThroughput(callingThread.ConnectivityMatrix, events);
            }

            //Raise events
            if (DiagnosticUpdate != null) {
                foreach (DiagnosticUpdateEventArgs args in events) {
                    DiagnosticUpdate(args);
                }
            }
        }