示例#1
0
            private static DurationInfo FindMaxDurationInfoFromStats(SessionStatistics stats, bool isArchive)
            {
                string       str          = isArchive ? "_Archive" : string.Empty;
                DurationInfo durationInfo = new DurationInfo
                {
                    Name     = string.Empty,
                    Duration = TimeSpan.Zero
                };

                if (stats != null)
                {
                    if (stats.SourceProviderInfo.Durations.Count > 0)
                    {
                        DurationInfo durationInfo2 = stats.SourceProviderInfo.Durations[0];
                        durationInfo.Name     = "SourceProvider_" + durationInfo2.Name + str;
                        durationInfo.Duration = durationInfo2.Duration;
                    }
                    if (stats.DestinationProviderInfo.Durations.Count > 0)
                    {
                        DurationInfo durationInfo2 = stats.DestinationProviderInfo.Durations[0];
                        if (durationInfo2.Duration > durationInfo.Duration)
                        {
                            durationInfo.Name     = "DestinationProvider_" + durationInfo2.Name + str;
                            durationInfo.Duration = durationInfo2.Duration;
                        }
                    }
                }
                return(durationInfo);
            }
示例#2
0
 SessionStatistics IMailbox.GetSessionStatistics(SessionStatisticsFlags statisticsTypes)
 {
     if (statisticsTypes.HasFlag(SessionStatisticsFlags.ContentIndexingWordBreaking) && this.StoreSession != null)
     {
         SessionStatistics      sessionStatistics      = new SessionStatistics();
         ContentIndexingSession contentIndexingSession = this.StoreSession.ContentIndexingSession as ContentIndexingSession;
         if (contentIndexingSession != null && contentIndexingSession.Statistics != null)
         {
             TransportFlowStatistics statistics = contentIndexingSession.Statistics;
             sessionStatistics.TotalMessagesProcessed      = statistics.TotalMessagesProcessed;
             sessionStatistics.TotalTimeProcessingMessages = statistics.TotalTimeProcessingMessages;
             sessionStatistics.TimeInGetConnection         = statistics.TimeInGetConnection;
             sessionStatistics.TimeInPropertyBagLoad       = statistics.TimeInPropertyBagLoad;
             sessionStatistics.TimeInMessageItemConversion = statistics.TimeInMessageItemConversion;
             sessionStatistics.TimeDeterminingAgeOfItem    = statistics.TimeDeterminingAgeOfItem;
             sessionStatistics.TimeInMimeConversion        = statistics.TimeInMimeConversion;
             sessionStatistics.TimeInShouldAnnotateMessage = statistics.TimeInShouldAnnotateMessage;
             sessionStatistics.TimeInWordbreaker           = statistics.TimeInWordbreaker;
             sessionStatistics.TimeInQueue = statistics.TimeInQueue;
             sessionStatistics.TimeProcessingFailedMessages = statistics.TimeProcessingFailedMessages;
             sessionStatistics.TimeInTransportRetriever     = statistics.TimeInTransportRetriever;
             sessionStatistics.TimeInDocParser               = statistics.TimeInDocParser;
             sessionStatistics.TimeInNLGSubflow              = statistics.TimeInNLGSubflow;
             sessionStatistics.MessageLevelFailures          = statistics.MessageLevelFailures;
             sessionStatistics.MessagesSuccessfullyAnnotated = statistics.MessagesSuccessfullyAnnotated;
             sessionStatistics.AnnotationSkipped             = statistics.AnnotationSkipped;
             sessionStatistics.ConnectionLevelFailures       = statistics.ConnectionLevelFailures;
         }
         return(sessionStatistics);
     }
     return(null);
 }
示例#3
0
 public static void Write(Guid requestGuid, SessionStatistics sessionStatistics, SessionStatistics archiveSessionStatistics)
 {
     if (sessionStatistics != null || archiveSessionStatistics != null)
     {
         SessionStatisticsLogData objectToLog = new SessionStatisticsLogData(requestGuid, sessionStatistics, archiveSessionStatistics);
         SessionStatisticsLog.instance.LogObject(objectToLog);
     }
 }
示例#4
0
        SessionStatistics IMailbox.GetSessionStatistics(SessionStatisticsFlags statisticsTypes)
        {
            SessionStatistics result = null;

            base.CreateContext("IDestinationMailbox.GetSessionStatistics", new DataContext[0]).Execute(delegate
            {
                result = this.WrappedObject.GetSessionStatistics(statisticsTypes);
            }, true);
            return(result);
        }
示例#5
0
        public void Append(LocalizedString msg, SessionStatistics sessionStatistics, SessionStatistics archiveSessionStatistics)
        {
            if (sessionStatistics == null && archiveSessionStatistics == null)
            {
                this.Append(new ReportEntry(msg));
                return;
            }
            ReportEntry reportEntry = new ReportEntry(msg);

            reportEntry.Flags |= ReportEntryFlags.SessionStatistics;
            if (sessionStatistics != null)
            {
                reportEntry.SessionStatistics = sessionStatistics;
                reportEntry.Flags            |= ReportEntryFlags.Primary;
            }
            if (archiveSessionStatistics != null)
            {
                reportEntry.ArchiveSessionStatistics = archiveSessionStatistics;
                reportEntry.Flags |= ReportEntryFlags.Archive;
            }
            this.Append(reportEntry);
        }
示例#6
0
        internal Report(ReportData reportData)
        {
            SessionStatistics stats  = new SessionStatistics();
            SessionStatistics stats2 = new SessionStatistics();

            this.SessionStatistics        = new SessionStatistics();
            this.ArchiveSessionStatistics = new SessionStatistics();
            foreach (ReportEntry reportEntry in reportData.Entries)
            {
                if ((reportEntry.Flags & (ReportEntryFlags.TargetThrottleDurations | ReportEntryFlags.SourceThrottleDurations)) != ReportEntryFlags.None)
                {
                    if ((reportEntry.Flags & ReportEntryFlags.SourceThrottleDurations) != ReportEntryFlags.None)
                    {
                        this.SourceThrottles = new Throttles(reportEntry.SourceThrottleDurations);
                    }
                    if ((reportEntry.Flags & ReportEntryFlags.TargetThrottleDurations) != ReportEntryFlags.None)
                    {
                        this.TargetThrottles = new Throttles(reportEntry.TargetThrottleDurations);
                    }
                }
                else
                {
                    if (reportEntry.Type == ReportEntryType.Debug)
                    {
                        this.AddToLazyList <ReportEntry>(ref this.debugEntries, reportEntry);
                    }
                    else
                    {
                        this.AddToLazyList <ReportEntry>(ref this.entries, reportEntry);
                    }
                    if (reportEntry.Type == ReportEntryType.Warning || reportEntry.Type == ReportEntryType.WarningCondition)
                    {
                        this.AddToLazyList <ReportEntry>(ref this.warnings, reportEntry);
                    }
                    if (reportEntry.Failure != null)
                    {
                        this.AddToLazyList <FailureRec>(ref this.failures, reportEntry.Failure);
                    }
                    if (reportEntry.BadItem != null)
                    {
                        BadItemKind kind = reportEntry.BadItem.Kind;
                        if (kind == BadItemKind.LargeItem)
                        {
                            this.AddToLazyList <BadMessageRec>(ref this.largeItems, reportEntry.BadItem);
                        }
                        else
                        {
                            this.AddToLazyList <BadMessageRec>(ref this.badItems, reportEntry.BadItem);
                        }
                    }
                    if ((reportEntry.Flags & ReportEntryFlags.MailboxVerificationResults) != ReportEntryFlags.None && reportEntry.MailboxVerificationResults != null)
                    {
                        this.MailboxVerification = new Report.ListWithToString <FolderSizeRec>();
                        this.MailboxVerification.AddRange(reportEntry.MailboxVerificationResults);
                    }
                    if ((reportEntry.Flags & ReportEntryFlags.SessionStatistics) != ReportEntryFlags.None)
                    {
                        if (reportEntry.SessionStatistics != null)
                        {
                            if (reportEntry.SessionStatistics.SessionId != this.SessionStatistics.SessionId)
                            {
                                this.SessionStatistics += stats;
                            }
                            stats = reportEntry.SessionStatistics;
                        }
                        if (reportEntry.ArchiveSessionStatistics != null)
                        {
                            if (reportEntry.ArchiveSessionStatistics.SessionId != this.ArchiveSessionStatistics.SessionId)
                            {
                                this.ArchiveSessionStatistics += stats2;
                            }
                            stats2 = reportEntry.ArchiveSessionStatistics;
                        }
                    }
                    if ((reportEntry.Flags & ReportEntryFlags.ConfigObject) != ReportEntryFlags.None && reportEntry.ConfigObject != null)
                    {
                        if ((reportEntry.Flags & ReportEntryFlags.Before) != ReportEntryFlags.None)
                        {
                            if ((reportEntry.Flags & ReportEntryFlags.Source) != ReportEntryFlags.None)
                            {
                                this.SourceMailboxBeforeMove = reportEntry.ConfigObject;
                            }
                            if ((reportEntry.Flags & ReportEntryFlags.Target) != ReportEntryFlags.None)
                            {
                                this.TargetMailUserBeforeMove = reportEntry.ConfigObject;
                            }
                        }
                        if ((reportEntry.Flags & ReportEntryFlags.After) != ReportEntryFlags.None)
                        {
                            if ((reportEntry.Flags & ReportEntryFlags.Source) != ReportEntryFlags.None)
                            {
                                this.SourceMailUserAfterMove = reportEntry.ConfigObject;
                            }
                            if ((reportEntry.Flags & ReportEntryFlags.Target) != ReportEntryFlags.None)
                            {
                                this.TargetMailboxAfterMove = reportEntry.ConfigObject;
                            }
                        }
                    }
                    if ((reportEntry.Flags & ReportEntryFlags.MailboxSize) != ReportEntryFlags.None && reportEntry.MailboxSize != null)
                    {
                        if ((reportEntry.Flags & ReportEntryFlags.Source) != ReportEntryFlags.None)
                        {
                            if ((reportEntry.Flags & ReportEntryFlags.Primary) != ReportEntryFlags.None)
                            {
                                this.SourceMailboxSize = reportEntry.MailboxSize;
                            }
                            if ((reportEntry.Flags & ReportEntryFlags.Archive) != ReportEntryFlags.None)
                            {
                                this.SourceArchiveMailboxSize = reportEntry.MailboxSize;
                            }
                        }
                        if ((reportEntry.Flags & ReportEntryFlags.Target) != ReportEntryFlags.None)
                        {
                            if ((reportEntry.Flags & ReportEntryFlags.Primary) != ReportEntryFlags.None)
                            {
                                this.TargetMailboxSize = reportEntry.MailboxSize;
                            }
                            if ((reportEntry.Flags & ReportEntryFlags.Archive) != ReportEntryFlags.None)
                            {
                                this.TargetArchiveMailboxSize = reportEntry.MailboxSize;
                            }
                        }
                    }
                    if (reportEntry.Connectivity != null)
                    {
                        this.AddToLazyList <Report.ConnectivityRecWithTimestamp>(ref this.connectivity, new Report.ConnectivityRecWithTimestamp(reportEntry.CreationTime, reportEntry.Connectivity));
                    }
                }
            }
            this.SessionStatistics        += stats;
            this.ArchiveSessionStatistics += stats2;
            Comparison <DurationInfo> comparison = (DurationInfo x, DurationInfo y) => y.Duration.CompareTo(x.Duration);

            this.SessionStatistics.SourceProviderInfo.Durations.Sort(comparison);
            this.SessionStatistics.DestinationProviderInfo.Durations.Sort(comparison);
            this.ArchiveSessionStatistics.SourceProviderInfo.Durations.Sort(comparison);
            this.ArchiveSessionStatistics.DestinationProviderInfo.Durations.Sort(comparison);
        }
 internal SessionStatisticsLogData(Guid requestGuid, SessionStatistics sessionStatistics, SessionStatistics archiveSessionStatistics)
 {
     this.RequestGuid              = requestGuid;
     this.SessionStatistics        = sessionStatistics;
     this.ArchiveSessionStatistics = archiveSessionStatistics;
 }
示例#8
0
            private static IEnumerable <IObjectLogPropertyDefinition <SessionStatisticsLogData> > GetLatencyInfo(bool isArchive = false)
            {
                List <IObjectLogPropertyDefinition <SessionStatisticsLogData> > list = new List <IObjectLogPropertyDefinition <SessionStatisticsLogData> >();
                string str = isArchive ? "_Archive" : string.Empty;
                Func <SessionStatisticsLogData, SessionStatistics> getStatsFunc = delegate(SessionStatisticsLogData logData)
                {
                    if (!isArchive)
                    {
                        return(logData.SessionStatistics);
                    }
                    return(logData.ArchiveSessionStatistics);
                };

                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("SourceLatencyInMillisecondsCurrent" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.SourceLatencyInfo.Current);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("SourceLatencyInMillisecondsAverage" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.SourceLatencyInfo.Average);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("SourceLatencyInMillisecondsMin" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null || sessionStatistics.SourceLatencyInfo.Min == int.MaxValue) ? 0 : sessionStatistics.SourceLatencyInfo.Min);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("SourceLatencyInMillisecondsMax" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null || sessionStatistics.SourceLatencyInfo.Max == int.MinValue) ? 0 : sessionStatistics.SourceLatencyInfo.Max);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("SourceLatencyNumberOfSamples" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.SourceLatencyInfo.NumberOfLatencySamplingCalls);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("SourceLatencyTotalNumberOfRemoteCalls" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.SourceLatencyInfo.TotalNumberOfRemoteCalls);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("DestinationLatencyInMillisecondsCurrent" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.DestinationLatencyInfo.Current);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("DestinationLatencyInMillisecondsAverage" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.DestinationLatencyInfo.Average);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("DestinationLatencyInMillisecondsMin" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.DestinationLatencyInfo.Min);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("DestinationLatencyInMillisecondsMax" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.DestinationLatencyInfo.Max);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("DestinationLatencyNumberOfSamples" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.DestinationLatencyInfo.NumberOfLatencySamplingCalls);
                }));
                list.Add(new ObjectLogSimplePropertyDefinition <SessionStatisticsLogData>("DestinationLatencyTotalNumberOfRemoteCalls" + str, delegate(SessionStatisticsLogData s)
                {
                    SessionStatistics sessionStatistics = getStatsFunc(s);
                    return((sessionStatistics == null) ? 0 : sessionStatistics.DestinationLatencyInfo.TotalNumberOfRemoteCalls);
                }));
                return(list);
            }