Esempio n. 1
0
 private void DumpDurationTree(StringBuilder strBuilder, RequestJobStateNode treeRoot, string indent)
 {
     strBuilder.AppendFormat("{0}{1}: {2}\n", indent, treeRoot.MRState.ToString(), this.GetDisplayDuration(treeRoot.MRState));
     indent += "  ";
     foreach (RequestJobStateNode treeRoot2 in treeRoot.Children)
     {
         this.DumpDurationTree(strBuilder, treeRoot2, indent);
     }
 }
Esempio n. 2
0
 static RequestJobStateNode()
 {
     RequestJobStateNode.CreateNode(RequestState.None, RequestState.None, null, null);
     RequestJobStateNode.CreateNode(RequestState.OverallMove, RequestState.None, null, null);
     RequestJobStateNode.CreateNode(RequestState.Queued, RequestState.OverallMove, null, null);
     RequestJobStateNode.CreateNode(RequestState.InProgress, RequestState.OverallMove, null, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesTotal);
     RequestJobStateNode.CreateNode(RequestState.InitializingMove, RequestState.InProgress, null, null);
     RequestJobStateNode.CreateNode(RequestState.InitialSeeding, RequestState.InProgress, null, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesInitialSeeding);
     RequestJobStateNode.CreateNode(RequestState.CreatingMailbox, RequestState.InitialSeeding, null, null);
     RequestJobStateNode.CreateNode(RequestState.CreatingFolderHierarchy, RequestState.InitialSeeding, null, null);
     RequestJobStateNode.CreateNode(RequestState.CreatingInitialSyncCheckpoint, RequestState.InitialSeeding, null, null);
     RequestJobStateNode.CreateNode(RequestState.LoadingMessages, RequestState.InitialSeeding, null, null);
     RequestJobStateNode.CreateNode(RequestState.CopyingMessages, RequestState.InitialSeeding, null, null);
     RequestJobStateNode.CreateNode(RequestState.Completion, RequestState.InProgress, null, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesCompletion);
     RequestJobStateNode.CreateNode(RequestState.IncrementalSync, RequestState.Completion, null, null);
     RequestJobStateNode.CreateNode(RequestState.Finalization, RequestState.Completion, null, null);
     RequestJobStateNode.CreateNode(RequestState.DataReplicationWait, RequestState.Finalization, null, null);
     RequestJobStateNode.CreateNode(RequestState.ADUpdate, RequestState.Finalization, null, null);
     RequestJobStateNode.CreateNode(RequestState.Cleanup, RequestState.Completion, null, null);
     RequestJobStateNode.CreateNode(RequestState.Stalled, RequestState.InProgress, (MDBPerfCounterHelper h) => h.StallsTotal, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesStalledTotal);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToHA, RequestState.Stalled, (MDBPerfCounterHelper h) => h.StallsHA, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesStalledHA);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToCI, RequestState.Stalled, (MDBPerfCounterHelper h) => h.StallsCI, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesStalledCI);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToMailboxLock, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToWriteThrottle, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToReadThrottle, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToReadCpu, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToWriteCpu, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToReadUnknown, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.StalledDueToWriteUnknown, RequestState.Stalled, null, null);
     RequestJobStateNode.CreateNode(RequestState.TransientFailure, RequestState.InProgress, (MDBPerfCounterHelper h) => h.TransientTotal, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesTransientFailures);
     RequestJobStateNode.CreateNode(RequestState.NetworkFailure, RequestState.TransientFailure, (MDBPerfCounterHelper h) => h.NetworkFailures, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesNetworkFailures);
     RequestJobStateNode.CreateNode(RequestState.MDBOffline, RequestState.TransientFailure, null, (MailboxReplicationServicePerMdbPerformanceCountersInstance pc) => pc.ActiveMovesMDBOffline);
     RequestJobStateNode.CreateNode(RequestState.ProxyBackoff, RequestState.TransientFailure, (MDBPerfCounterHelper h) => h.ProxyBackoff, null);
     RequestJobStateNode.CreateNode(RequestState.ServerBusyBackoff, RequestState.TransientFailure, null, null);
     RequestJobStateNode.CreateNode(RequestState.Suspended, RequestState.OverallMove, null, null);
     RequestJobStateNode.CreateNode(RequestState.AutoSuspended, RequestState.Suspended, null, null);
     RequestJobStateNode.CreateNode(RequestState.Relinquished, RequestState.OverallMove, null, null);
     RequestJobStateNode.CreateNode(RequestState.RelinquishedMDBFailover, RequestState.Relinquished, null, null);
     RequestJobStateNode.CreateNode(RequestState.RelinquishedDataGuarantee, RequestState.Relinquished, null, null);
     RequestJobStateNode.CreateNode(RequestState.RelinquishedCIStall, RequestState.Relinquished, null, null);
     RequestJobStateNode.CreateNode(RequestState.RelinquishedHAStall, RequestState.Relinquished, null, null);
     RequestJobStateNode.CreateNode(RequestState.RelinquishedWlmStall, RequestState.Relinquished, null, null);
     RequestJobStateNode.CreateNode(RequestState.Failed, RequestState.OverallMove, (MDBPerfCounterHelper h) => h.FailTotal, null);
     RequestJobStateNode.CreateNode(RequestState.FailedBadItemLimit, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailBadItemLimit, null);
     RequestJobStateNode.CreateNode(RequestState.FailedNetwork, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailNetwork, null);
     RequestJobStateNode.CreateNode(RequestState.FailedStallDueToCI, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailStallCI, null);
     RequestJobStateNode.CreateNode(RequestState.FailedStallDueToHA, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailStallHA, null);
     RequestJobStateNode.CreateNode(RequestState.FailedMAPI, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailMAPI, null);
     RequestJobStateNode.CreateNode(RequestState.FailedOther, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailOther, null);
     RequestJobStateNode.CreateNode(RequestState.FailedStuck, RequestState.Failed, (MDBPerfCounterHelper h) => h.FailOther, null);
     RequestJobStateNode.CreateNode(RequestState.Completed, RequestState.None, (MDBPerfCounterHelper h) => h.Completed, null);
     RequestJobStateNode.CreateNode(RequestState.CompletedWithWarnings, RequestState.Completed, (MDBPerfCounterHelper h) => h.CompletedWithWarnings, null);
     RequestJobStateNode.CreateNode(RequestState.Canceled, RequestState.None, (MDBPerfCounterHelper h) => h.Canceled, null);
 }
Esempio n. 3
0
 public static bool RequestStateIs(RequestState currentState, RequestState stateToCheck)
 {
     for (RequestJobStateNode requestJobStateNode = RequestJobStateNode.GetState(currentState); requestJobStateNode != null; requestJobStateNode = requestJobStateNode.Parent)
     {
         if (requestJobStateNode.MRState == stateToCheck)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 4
0
 private void IncRateCounts(RequestState rjState)
 {
     if (this.pcHelper == null)
     {
         return;
     }
     for (RequestJobStateNode requestJobStateNode = RequestJobStateNode.GetState(rjState); requestJobStateNode != null; requestJobStateNode = requestJobStateNode.Parent)
     {
         if (requestJobStateNode.GetCountRatePerfCounter != null)
         {
             requestJobStateNode.GetCountRatePerfCounter(this.pcHelper).IncrementBy(1L);
         }
     }
 }
Esempio n. 5
0
 private void UpdateActiveCounts(RequestState rjState, long delta)
 {
     if (this.pcHelper == null)
     {
         return;
     }
     for (RequestJobStateNode requestJobStateNode = RequestJobStateNode.GetState(rjState); requestJobStateNode != null; requestJobStateNode = requestJobStateNode.Parent)
     {
         if (requestJobStateNode.GetActivePerfCounter != null)
         {
             requestJobStateNode.GetActivePerfCounter(this.pcHelper.PerfCounter).IncrementBy(delta);
         }
     }
 }
Esempio n. 6
0
        public RequestJobDurationData GetDuration(RequestState state)
        {
            RequestJobDurationData requestJobDurationData = null;
            RequestJobDurationData requestJobDurationData2;

            if (this.durations.TryGetValue(state, out requestJobDurationData2))
            {
                requestJobDurationData = requestJobDurationData2;
            }
            if (state == this.curState)
            {
                DateTime utcNow   = TimeProvider.UtcNow;
                TimeSpan duration = utcNow.Subtract(this.stateChangeTimestamp);
                if (requestJobDurationData == null)
                {
                    requestJobDurationData = new RequestJobDurationData(state);
                    requestJobDurationData.AddTime(duration);
                    this.durations[this.curState] = requestJobDurationData;
                }
                else
                {
                    requestJobDurationData.AddTime(duration);
                }
                this.stateChangeTimestamp = utcNow;
            }
            RequestJobStateNode state2 = RequestJobStateNode.GetState(state);

            if (state2 != null)
            {
                foreach (RequestJobStateNode requestJobStateNode in state2.Children)
                {
                    RequestJobDurationData duration2 = this.GetDuration(requestJobStateNode.MRState);
                    if (duration2 != null)
                    {
                        requestJobDurationData += duration2;
                    }
                }
            }
            return(requestJobDurationData);
        }
Esempio n. 7
0
        private RequestJobTimeTrackerXML.DurationRec DumpDurationTreeForDiagnostics(RequestJobStateNode treeRoot, bool showTimeSlots = false)
        {
            RequestJobDurationData displayDuration = this.GetDisplayDuration(treeRoot.MRState);

            if (displayDuration == null)
            {
                return(null);
            }
            RequestJobTimeTrackerXML.DurationRec durationRec = displayDuration.GetDurationRec(treeRoot.MRState, showTimeSlots);
            foreach (RequestJobStateNode treeRoot2 in treeRoot.Children)
            {
                RequestJobTimeTrackerXML.DurationRec durationRec2 = this.DumpDurationTreeForDiagnostics(treeRoot2, showTimeSlots);
                if (durationRec2 != null && durationRec2.Duration != TimeSpan.Zero.ToString())
                {
                    if (durationRec.ChildNodes == null)
                    {
                        durationRec.ChildNodes = new List <RequestJobTimeTrackerXML.DurationRec>();
                    }
                    durationRec.ChildNodes.Add(durationRec2);
                }
            }
            return(durationRec);
        }