예제 #1
0
        private static TimeSpan CalculateIncomingReplicationLatency(ADMetrics newMetrics, int traceKey)
        {
            TimeSpan        t               = TimeSpan.Zero;
            TimeSpan        timeSpan        = TimeSpan.Zero;
            ADServerMetrics adserverMetrics = null;
            int             num             = 0;

            foreach (ADServerMetrics adserverMetrics2 in newMetrics.AllServerMetrics)
            {
                if (adserverMetrics2.IsSuitable && adserverMetrics2.InjectionRate >= 0.0)
                {
                    long num2 = 0L;
                    foreach (ADReplicationLinkMetrics adreplicationLinkMetrics in adserverMetrics2.ConfigReplicationMetrics)
                    {
                        if (newMetrics[adreplicationLinkMetrics.NeighborDnsHostName].IsSuitable)
                        {
                            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, long, long>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] Config replicaiton partner={0}, HighestUsn={1}, UpToDatenessUsn={2}.", newMetrics[adreplicationLinkMetrics.NeighborDnsHostName].DnsHostName, newMetrics[adreplicationLinkMetrics.NeighborDnsHostName].HighestUsn, adreplicationLinkMetrics.UpToDatenessUsn);
                            num2 += newMetrics[adreplicationLinkMetrics.NeighborDnsHostName].HighestUsn - adreplicationLinkMetrics.UpToDatenessUsn;
                        }
                    }
                    foreach (ADReplicationLinkMetrics adreplicationLinkMetrics2 in adserverMetrics2.DomainReplicationMetrics)
                    {
                        if (newMetrics[adreplicationLinkMetrics2.NeighborDnsHostName].IsSuitable)
                        {
                            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, long, long>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] Domain replicaiton partner={0}, HighestUsn={1}, UpToDatenessUsn={2}.", newMetrics[adreplicationLinkMetrics2.NeighborDnsHostName].DnsHostName, newMetrics[adreplicationLinkMetrics2.NeighborDnsHostName].HighestUsn, adreplicationLinkMetrics2.UpToDatenessUsn);
                            num2 += newMetrics[adreplicationLinkMetrics2.NeighborDnsHostName].HighestUsn - adreplicationLinkMetrics2.UpToDatenessUsn;
                        }
                    }
                    adserverMetrics2.IncomingDebt = num2;
                    ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, long>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] {0}: IncomingDebt={1}.", adserverMetrics2.DnsHostName, num2);
                    TimeSpan timeSpan2 = ADResourceHealthMonitor.CalculateReplicationLatency((double)num2, adserverMetrics2.InjectionRate, traceKey);
                    ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, TimeSpan, double>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] {0}: replicationLatency={1}, injectionRate={2}.", adserverMetrics2.DnsHostName, timeSpan2, adserverMetrics2.InjectionRate);
                    if (timeSpan2 > timeSpan || adserverMetrics == null)
                    {
                        timeSpan        = timeSpan2;
                        adserverMetrics = adserverMetrics2;
                    }
                    t += timeSpan2;
                    num++;
                }
            }
            TimeSpan timeSpan3 = TimeSpan.Zero;

            if (num > 2)
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <TimeSpan, string>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] Ignoring worst incoming health measure {0} on DC {1}.", timeSpan, (adserverMetrics != null) ? adserverMetrics.DnsHostName : "<none>");
                timeSpan3 = TimeSpan.FromTicks((t - timeSpan).Ticks / (long)(num - 1));
            }
            else if (num > 1)
            {
                timeSpan3 = TimeSpan.FromTicks(t.Ticks / (long)num);
            }
            else
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] Single suitable DCs. Considering fully healthy.");
                timeSpan3 = TimeSpan.Zero;
            }
            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <TimeSpan>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationLatency] Total IncomingHealthMeasure={0}.", timeSpan3);
            return(timeSpan3);
        }
예제 #2
0
        private ICollection <ADReplicationLinkMetrics> ReadReplicationMetrics(IEnumerable <ReplicationCursor> replicationCursors)
        {
            List <ADReplicationLinkMetrics> list = new List <ADReplicationLinkMetrics>(2);

            foreach (ReplicationCursor replicationCursor in replicationCursors)
            {
                if (replicationCursor.SourceDsa != null)
                {
                    using (IEnumerator <ADServerMetrics> enumerator2 = this.AllServerMetrics.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            ADServerMetrics adserverMetrics = enumerator2.Current;
                            if (adserverMetrics.IsSuitable && string.Equals(replicationCursor.SourceDsa.Parent.Name, adserverMetrics.ServerId.Name, StringComparison.OrdinalIgnoreCase))
                            {
                                list.Add(new ADReplicationLinkMetrics(adserverMetrics.DnsHostName, replicationCursor.UpToDatenessUsn));
                                break;
                            }
                        }
                        continue;
                    }
                }
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <Guid>((long)this.GetHashCode(), "[ADMetrics::ReadReplicationMetrics] Replication cursor with SourceInvocationId={0} does not have SourceDsa.", replicationCursor.SourceInvocationId);
            }
            return(list);
        }
예제 #3
0
        private void PopulateSingleServerMetrics(ADServerMetrics dcMetrics)
        {
            Exception ex = null;

            try
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "[ADMetrics::PopulateSingleServerMetrics] Reading metrics for {0}.", dcMetrics.DnsHostName);
                string          text;
                LocalizedString localizedString;
                if (!SuitabilityVerifier.IsServerSuitableIgnoreExceptions(dcMetrics.DnsHostName, false, null, out text, out localizedString))
                {
                    ExTraceGlobals.ResourceHealthManagerTracer.TraceError <string, LocalizedString>((long)this.GetHashCode(), "[ADMetrics::PopulateSingleServerMetrics] Suitability checks failed for {0}: {1}", dcMetrics.DnsHostName, localizedString);
                    dcMetrics.ErrorMessage = localizedString;
                    return;
                }
                ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(dcMetrics.DnsHostName, true, ConsistencyMode.PartiallyConsistent, null, ADSessionSettings.FromAccountPartitionRootOrgScopeSet(new PartitionId(this.forestFqdn)), 470, "PopulateSingleServerMetrics", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\throttling\\ResourceHealth\\ADMetrics.cs");
                topologyConfigurationSession.UseGlobalCatalog = false;
                ExDateTime utcNow  = ExDateTime.UtcNow;
                RootDse    rootDse = topologyConfigurationSession.GetRootDse();
                dcMetrics.IsSynchronized = rootDse.IsSynchronized;
                if (!dcMetrics.IsSynchronized)
                {
                    ExTraceGlobals.ResourceHealthManagerTracer.TraceError <string>((long)this.GetHashCode(), "[ADMetrics::PopulateSingleServerMetrics] {0} is not synchronized yet.", dcMetrics.DnsHostName);
                    return;
                }
                MultiValuedProperty <ReplicationCursor>   source;
                MultiValuedProperty <ReplicationNeighbor> neighbors;
                topologyConfigurationSession.ReadReplicationData(topologyConfigurationSession.ConfigurationNamingContext, out source, out neighbors);
                IEnumerable <ReplicationCursor> replicationCursors = from cursor in source
                                                                     where neighbors.Any((ReplicationNeighbor neighbor) => this.NotNullAndEquals(neighbor.SourceDsa, cursor.SourceDsa))
                                                                     select cursor;
                ICollection <ADReplicationLinkMetrics> configReplicationMetrics = this.ReadReplicationMetrics(replicationCursors);
                topologyConfigurationSession.UseConfigNC = false;
                topologyConfigurationSession.ReadReplicationData(dcMetrics.ServerId.DomainId, out source, out neighbors);
                replicationCursors = from cursor in source
                                     where neighbors.Any((ReplicationNeighbor neighbor) => this.NotNullAndEquals(neighbor.SourceDsa, cursor.SourceDsa))
                                     select cursor;
                ICollection <ADReplicationLinkMetrics> domainReplicationMetrics = this.ReadReplicationMetrics(replicationCursors);
                dcMetrics.Initialize(utcNow, rootDse.HighestCommittedUSN, configReplicationMetrics, domainReplicationMetrics);
                dcMetrics.IsSuitable = true;
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "[ADMetrics::PopulateSingleServerMetrics] Finished reading metrics for {0}.", dcMetrics.DnsHostName);
            }
            catch (ADTransientException ex2)
            {
                ex = ex2;
            }
            catch (ADOperationException ex3)
            {
                ex = ex3;
            }
            catch (OperationCanceledException ex4)
            {
                ex = ex4;
            }
            if (ex != null)
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceError <string, Exception>((long)this.GetHashCode(), "[ADMetrics::PopulateSingleServerMetrics] Failed to get read AD metrics from {0}: {1}", dcMetrics.DnsHostName, ex);
                dcMetrics.ErrorMessage = new LocalizedString(ex.Message);
            }
        }
예제 #4
0
 internal void AddServerMetrics(ADServerMetrics metrics)
 {
     if (metrics == null)
     {
         throw new ArgumentNullException("metrics");
     }
     if (metrics.DnsHostName == null)
     {
         throw new ArgumentNullException("metrics.DnsHostName");
     }
     this.allADServerMetrics.Add(metrics.DnsHostName, metrics);
 }
예제 #5
0
        private static int CalculateOutgoingReplicationHealth(ADMetrics newMetrics, int traceKey)
        {
            int             num             = 100;
            ADServerMetrics adserverMetrics = null;

            using (IEnumerator <ADServerMetrics> enumerator = newMetrics.AllServerMetrics.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ADServerMetrics dcMetrics = enumerator.Current;
                    if (dcMetrics.IsSuitable && dcMetrics.InjectionRate >= 0.0)
                    {
                        foreach (ADServerMetrics adserverMetrics2 in newMetrics.AllServerMetrics)
                        {
                            if (adserverMetrics2.IsSuitable && adserverMetrics2.InjectionRate >= 0.0)
                            {
                                long?num2 = null;
                                foreach (ICollection <ADReplicationLinkMetrics> source in new ICollection <ADReplicationLinkMetrics>[]
                                {
                                    adserverMetrics2.ConfigReplicationMetrics,
                                    adserverMetrics2.DomainReplicationMetrics
                                })
                                {
                                    ADReplicationLinkMetrics adreplicationLinkMetrics = source.FirstOrDefault((ADReplicationLinkMetrics linkMetrics) => linkMetrics.NeighborDnsHostName.Equals(dcMetrics.DnsHostName, StringComparison.OrdinalIgnoreCase));
                                    if (adreplicationLinkMetrics != null && (num2 == null || num2.Value > dcMetrics.HighestUsn - adreplicationLinkMetrics.UpToDatenessUsn))
                                    {
                                        num2 = new long?(dcMetrics.HighestUsn - adreplicationLinkMetrics.UpToDatenessUsn);
                                    }
                                }
                                dcMetrics.OutgoingDebt = (num2 ?? 0L);
                                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, long>((long)traceKey, "[ADResourceHealthMonitor::CalculateOutgoingReplicationHealth] {0}: OutgoingDebt={1}.", dcMetrics.DnsHostName, dcMetrics.OutgoingDebt);
                                dcMetrics.OutgoingHealth = ADResourceHealthMonitor.CalculateReplicationHealthMeasure((double)dcMetrics.OutgoingDebt, adserverMetrics2.InjectionRate, traceKey);
                                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, int>((long)traceKey, "[ADResourceHealthMonitor::CalculateOutgoingReplicationHealth] {0}: OutgoingHealthMeasure={1}.", dcMetrics.DnsHostName, dcMetrics.OutgoingHealth);
                                if (dcMetrics.OutgoingHealth < num || adserverMetrics == null)
                                {
                                    num             = dcMetrics.OutgoingHealth;
                                    adserverMetrics = dcMetrics;
                                }
                            }
                        }
                    }
                }
            }
            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <int, string>((long)traceKey, "[ADResourceHealthMonitor::CalculateOutgoingReplicationHealth] Min OutgoingHealthMeasure={0} on DC {1}.", num, (adserverMetrics != null) ? adserverMetrics.DnsHostName : "<none>");
            newMetrics.OutgoingHealth = num;
            if (num < 100)
            {
                newMetrics.MinOutgoingHealthServer = adserverMetrics.DnsHostName;
            }
            return(num);
        }
 // Token: 0x06007648 RID: 30280 RVA: 0x00185804 File Offset: 0x00183A04
 internal void SetInjectionRate(ADServerMetrics previousMetrics)
 {
     if (!this.IsSuitable)
     {
         throw new InvalidOperationException();
     }
     if (previousMetrics != null && previousMetrics.IsSuitable)
     {
         this.InjectionRate = (double)(this.HighestUsn - previousMetrics.HighestUsn) / (this.UpdateTime - previousMetrics.UpdateTime).TotalSeconds;
     }
     else
     {
         ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string>((long)this.GetHashCode(), "[ADServerMetrics::SetInjectionRate] Could not calculate actual injection rate for {0} because there no previous data for this DC.", this.DnsHostName);
         this.InjectionRate = (double)this.HighestUsn;
     }
     ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, double>((long)this.GetHashCode(), "[ADServerMetrics::SetInjectionRate] {0}: InjectionRate={1}.", this.DnsHostName, this.InjectionRate);
 }
예제 #7
0
        private static TimeSpan CalculateOutgoingReplicationLatency(ADMetrics newMetrics, int traceKey)
        {
            TimeSpan        timeSpan        = TimeSpan.Zero;
            ADServerMetrics adserverMetrics = null;

            using (IEnumerator <ADServerMetrics> enumerator = newMetrics.AllServerMetrics.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ADServerMetrics dcMetrics = enumerator.Current;
                    if (dcMetrics.IsSuitable && dcMetrics.InjectionRate >= 0.0)
                    {
                        foreach (ADServerMetrics adserverMetrics2 in newMetrics.AllServerMetrics)
                        {
                            if (adserverMetrics2.IsSuitable && adserverMetrics2.InjectionRate >= 0.0)
                            {
                                long num = 0L;
                                foreach (ICollection <ADReplicationLinkMetrics> source in new ICollection <ADReplicationLinkMetrics>[]
                                {
                                    adserverMetrics2.ConfigReplicationMetrics,
                                    adserverMetrics2.DomainReplicationMetrics
                                })
                                {
                                    ADReplicationLinkMetrics adreplicationLinkMetrics = source.FirstOrDefault((ADReplicationLinkMetrics linkMetrics) => linkMetrics.NeighborDnsHostName.Equals(dcMetrics.DnsHostName, StringComparison.OrdinalIgnoreCase));
                                    if (adreplicationLinkMetrics != null)
                                    {
                                        num += dcMetrics.HighestUsn - adreplicationLinkMetrics.UpToDatenessUsn;
                                    }
                                }
                                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, long>((long)traceKey, "[ADResourceHealthMonitor::CalculateOutgoingReplicationLatency] {0}: OutgoingDebt={1}.", dcMetrics.DnsHostName, num);
                                dcMetrics.OutgoingDebt = num;
                                TimeSpan timeSpan2 = ADResourceHealthMonitor.CalculateReplicationLatency((double)num, adserverMetrics2.InjectionRate, traceKey);
                                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, TimeSpan>((long)traceKey, "[ADResourceHealthMonitor::CalculateOutgoingReplicationLatency] {0}: replicationLatency={1}.", dcMetrics.DnsHostName, timeSpan2);
                                if (timeSpan2 > timeSpan || adserverMetrics == null)
                                {
                                    timeSpan        = timeSpan2;
                                    adserverMetrics = dcMetrics;
                                }
                            }
                        }
                    }
                }
            }
            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <TimeSpan, string>((long)traceKey, "[ADResourceHealthMonitor::CalculateOutgoingReplicationLatency] Min OutgoingHealthMeasure={0} on DC {1}.", timeSpan, (adserverMetrics != null) ? adserverMetrics.DnsHostName : "<none>");
            return(timeSpan);
        }
예제 #8
0
        private static int CalculateIncomingReplicationHealth(ADMetrics newMetrics, int traceKey)
        {
            double          num             = 0.0;
            int             num2            = 100;
            ADServerMetrics adserverMetrics = null;
            int             num3            = 0;

            foreach (ADServerMetrics adserverMetrics2 in newMetrics.AllServerMetrics)
            {
                if (adserverMetrics2.IsSuitable && adserverMetrics2.InjectionRate >= 0.0)
                {
                    adserverMetrics2.IncomingDebt = 0L;
                    foreach (ADReplicationLinkMetrics adreplicationLinkMetrics in adserverMetrics2.ConfigReplicationMetrics)
                    {
                        if (newMetrics[adreplicationLinkMetrics.NeighborDnsHostName].IsSuitable)
                        {
                            adreplicationLinkMetrics.Debt = newMetrics[adreplicationLinkMetrics.NeighborDnsHostName].HighestUsn - adreplicationLinkMetrics.UpToDatenessUsn;
                            if (adreplicationLinkMetrics.Debt > adserverMetrics2.IncomingDebt)
                            {
                                adserverMetrics2.IncomingDebt = adreplicationLinkMetrics.Debt;
                            }
                        }
                    }
                    foreach (ADReplicationLinkMetrics adreplicationLinkMetrics2 in adserverMetrics2.DomainReplicationMetrics)
                    {
                        if (newMetrics[adreplicationLinkMetrics2.NeighborDnsHostName].IsSuitable)
                        {
                            adreplicationLinkMetrics2.Debt = newMetrics[adreplicationLinkMetrics2.NeighborDnsHostName].HighestUsn - adreplicationLinkMetrics2.UpToDatenessUsn;
                            if (adreplicationLinkMetrics2.Debt > adserverMetrics2.IncomingDebt)
                            {
                                adserverMetrics2.IncomingDebt = adreplicationLinkMetrics2.Debt;
                            }
                        }
                    }
                    ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, long>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationHealth] {0}: IncomingDebt={1}.", adserverMetrics2.DnsHostName, adserverMetrics2.IncomingDebt);
                    adserverMetrics2.IncomingHealth = ADResourceHealthMonitor.CalculateReplicationHealthMeasure((double)adserverMetrics2.IncomingDebt, adserverMetrics2.InjectionRate, traceKey);
                    ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <string, int>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationHealth] {0}: IncomingHealthMeasure={1}.", adserverMetrics2.DnsHostName, adserverMetrics2.IncomingHealth);
                    if (adserverMetrics2.IncomingHealth < num2 || adserverMetrics == null)
                    {
                        num2            = adserverMetrics2.IncomingHealth;
                        adserverMetrics = adserverMetrics2;
                    }
                    num += (double)adserverMetrics2.IncomingHealth;
                    num3++;
                }
            }
            int num4;

            if (num3 > 2)
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <int, string>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationHealth] Ignoring worst incoming health measure {0} on DC {1}.", num2, (adserverMetrics != null) ? adserverMetrics.DnsHostName : "<none>");
                num4 = (int)((num - (double)num2) / (double)(num3 - 1));
            }
            else if (num3 > 1)
            {
                num4 = (int)(num / (double)num3);
            }
            else
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationHealth] Single suitable DCs. Considering fully healthy.");
                num4 = 100;
            }
            ExTraceGlobals.ResourceHealthManagerTracer.TraceDebug <int>((long)traceKey, "[ADResourceHealthMonitor::CalculateIncomingReplicationHealth] Total IncomingHealthMeasure={0}.", num4);
            newMetrics.IncomingHealth = num4;
            if (num2 < 100)
            {
                newMetrics.MinIncomingHealthServer = adserverMetrics.DnsHostName;
            }
            return(num4);
        }
예제 #9
0
 public AsyncState(ADServerMetrics dcMetrics, ADMetrics adMetrics)
 {
     this.ServerMetrics = dcMetrics;
     this.ADMetrics     = adMetrics;
 }
예제 #10
0
        private bool Populate(ADMetrics previousMetrics)
        {
            try
            {
                if (this.rediscoverTopology)
                {
                    this.PopulateTopologyVersion();
                    this.PopulateADServersList();
                }
                foreach (ADServer dc in this.serversList)
                {
                    this.AddServerMetrics(new ADServerMetrics(dc));
                }
            }
            catch (ADTransientException arg)
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceError <ADTransientException>((long)this.GetHashCode(), "[ADMetrics::Populate] Failed to get read a list of DC: {0}", arg);
                return(false);
            }
            catch (ADOperationException arg2)
            {
                ExTraceGlobals.ResourceHealthManagerTracer.TraceError <ADOperationException>((long)this.GetHashCode(), "[ADMetrics::Populate] Failed to get read a list of DC: {0}", arg2);
                return(false);
            }
            List <ADServerMetrics> list = new List <ADServerMetrics>();

            foreach (ADServerMetrics adserverMetrics in this.AllServerMetrics)
            {
                ADServerMetrics adserverMetrics2 = (previousMetrics != null) ? previousMetrics[adserverMetrics.DnsHostName] : null;
                if (this.rediscoverTopology || adserverMetrics2 == null || adserverMetrics2.IsSuitable)
                {
                    list.Add(adserverMetrics);
                }
            }
            if (list.Count <= 0)
            {
                goto IL_1C3;
            }
            using (ActivityContext.SuppressThreadScope())
            {
                CancellationTokenSource cts = new CancellationTokenSource();
                using (new Timer(delegate(object _)
                {
                    cts.Cancel();
                }, null, 120000, -1))
                {
                    try
                    {
                        Parallel.ForEach <ADServerMetrics>(list, new ParallelOptions
                        {
                            CancellationToken = cts.Token
                        }, delegate(ADServerMetrics item)
                        {
                            try
                            {
                                Interlocked.Increment(ref this.pooledDiscoveryCount);
                                this.PopulateSingleServerMetrics(item);
                            }
                            finally
                            {
                                Interlocked.Decrement(ref this.pooledDiscoveryCount);
                            }
                        });
                    }
                    catch (OperationCanceledException arg3)
                    {
                        ExTraceGlobals.ResourceHealthManagerTracer.TraceError <OperationCanceledException>((long)this.GetHashCode(), "[ADMetrics::PopulateSingleServerMetrics] Timed out trying to read AD metrics from DCs: {0}", arg3);
                    }
                }
                goto IL_1C3;
            }
IL_1B9:
            Thread.Sleep(500);
IL_1C3:
            if (this.pooledDiscoveryCount <= 0)
            {
                return(this.AllServerMetrics.Any((ADServerMetrics server) => server.IsSuitable));
            }
            goto IL_1B9;
        }