/// <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); } } }
public void Start() { if (m_Thread != null) { Stop(); } m_Thread = new DiagnosticMonitorThread(m_Service, this); }
public void Stop() { if (m_Thread != null) { m_Thread.Stop(); m_Thread = null; } }
public void Start() { if (m_Thread != null) { Stop(); } m_Thread = new DiagnosticMonitorThread(m_Service,this); }
/// <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); } } }