コード例 #1
0
        // Token: 0x06001501 RID: 5377 RVA: 0x00052ED0 File Offset: 0x000510D0
        public static MonitoringADConfig GetConfig(AmServerName serverName, IReplayAdObjectLookup adLookup, IReplayAdObjectLookup adLookupPartiallyConsistent, IADToplogyConfigurationSession adSession, IADToplogyConfigurationSession adSessionPartiallyConsistent, Func <bool> isServiceShuttingDownFunc)
        {
            ReplayServerPerfmon.ADConfigRefreshCalls.Increment();
            ReplayServerPerfmon.ADConfigRefreshCallsPerSec.Increment();
            Stopwatch          stopwatch = Stopwatch.StartNew();
            MonitoringADConfig config    = new MonitoringADConfig(serverName, adLookup, adLookupPartiallyConsistent, adSession, adSessionPartiallyConsistent, isServiceShuttingDownFunc);
            Exception          ex        = ADUtils.RunADOperation(delegate()
            {
                config.Refresh();
            }, 2);

            ReplayServerPerfmon.ADConfigRefreshLatency.IncrementBy(stopwatch.ElapsedTicks);
            ReplayServerPerfmon.ADConfigRefreshLatencyBase.Increment();
            ExTraceGlobals.ADCacheTracer.TraceDebug <TimeSpan>((long)config.GetHashCode(), "MonitoringADConfig.GetConfig took {0}", stopwatch.Elapsed);
            if (stopwatch.Elapsed > MonitoringADConfig.MaxHealthyADRefreshDuration)
            {
                ReplayCrimsonEvents.ADConfigRefreshWasSlow.LogPeriodic <TimeSpan>(Environment.MachineName, DiagCore.DefaultEventSuppressionInterval, stopwatch.Elapsed);
            }
            if (ex != null)
            {
                MonitoringADConfig.Tracer.TraceError <string, string>((long)config.GetHashCode(), "MonitoringADConfig.GetConfig( {0} ): Got exception: {1}", serverName.NetbiosName, AmExceptionHelper.GetExceptionToStringOrNoneString(ex));
                ReplayCrimsonEvents.ADConfigRefreshFailed.LogPeriodic <string, string>(Environment.MachineName, DiagCore.DefaultEventSuppressionInterval, ex.ToString(), Environment.StackTrace);
                throw new MonitoringADConfigException(ex.Message, ex);
            }
            return(config);
        }
コード例 #2
0
        private void RefreshInternal()
        {
            MonitoringADConfig config = null;
            Exception          ex     = null;

            try
            {
                Dependencies.ReplayAdObjectLookup.Clear();
                config = MonitoringADConfig.GetConfig(new AmServerName(Dependencies.ManagementClassHelper.LocalComputerFqdn), this.m_adObjectLookup, this.m_adObjectLookupPartiallyConsistent, this.m_adSession, this.m_adSessionPartiallyConsistent, () => base.PrepareToStopCalled);
                this.healthReporter.RaiseGreenEvent();
            }
            catch (MonitoringADConfigException ex2)
            {
                ex = ex2;
                ReplayCrimsonEvents.MonitoringADLookupError.LogPeriodic <string, MonitoringADConfigException>(this.GetHashCode(), DiagCore.DefaultEventSuppressionInterval, ex2.ErrorMsg, ex2);
                this.healthReporter.RaiseRedEvent(ex2.ErrorMsg);
            }
            finally
            {
                lock (this.m_locker)
                {
                    if (ex == null)
                    {
                        this.m_config = config;
                    }
                    this.LastException = ex;
                }
                this.m_firstLookupCompleted.Set();
            }
        }
コード例 #3
0
        // Token: 0x060013B9 RID: 5049 RVA: 0x000502BC File Offset: 0x0004E4BC
        public void Initialize()
        {
            if (Interlocked.CompareExchange(ref this.m_fInitialized, 1, 0) == 1)
            {
                return;
            }
            this.ADConfig = MonitoringADConfig.GetConfig(new AmServerName(this.m_serverName, true), Dependencies.ReplayAdObjectLookup, Dependencies.ReplayAdObjectLookupPartiallyConsistent, ADSessionFactory.CreateIgnoreInvalidRootOrgSession(true), ADSessionFactory.CreatePartiallyConsistentRootOrgSession(true), null);
            ActiveManager noncachingActiveManagerInstance             = ActiveManager.GetNoncachingActiveManagerInstance();
            AmMultiNodeCopyStatusFetcher amMultiNodeCopyStatusFetcher = new AmMultiNodeCopyStatusFetcher(this.ADConfig.AmServerNames, this.ADConfig.DatabaseMap, RpcGetDatabaseCopyStatusFlags2.None, noncachingActiveManagerInstance, false);
            Dictionary <Guid, Dictionary <AmServerName, CopyStatusClientCachedEntry> > status = amMultiNodeCopyStatusFetcher.GetStatus();
            CopyStatusClientLookupTable copyStatusClientLookupTable = new CopyStatusClientLookupTable();

            copyStatusClientLookupTable.UpdateCopyStatusCachedEntries(status);
            this.CopyStatusLookup = new CopyStatusClientLookup(copyStatusClientLookupTable, null, noncachingActiveManagerInstance);
        }