private void TrackUids(IEnumerable <XElement> uids, MailboxLogEntry entry, ReportRowBase row) { foreach (XElement uid in uids) { MeetingTrackerItem meeting = GetTrackedMeeting(uid.Value); ApplicationData applicationData = new ApplicationData(uid.Parent); // Check to see if the OrganizerBytes have changed... if (meeting.OrganizerBytes != applicationData.OrganizerName) { if (meeting.OrganizerBytes != 0) { row.Columns[MeetingTrackerReport.OrganizerChanged] = "TRUE"; } meeting.OrganizerBytes = applicationData.OrganizerName; } // Check to see if the meeting loses attendees if (!meeting.HasAttendees.HasValue) { meeting.HasAttendees = applicationData.HasAttendees; } else if (meeting.HasAttendees.Value != applicationData.HasAttendees) { row.Columns[MeetingTrackerReport.HasAttendeesChanged] = "TRUE"; meeting.HasAttendees = applicationData.HasAttendees; } } }
private SyncRequest(MailboxLogEntry parent) : base(ParsedObjectType.SyncRequest) { this.LogEntry = parent; this.Collections = null; }
internal override void ProcessLogEntry(MailboxLogEntry entry) { ReportRowBase row = new DummyReportRow(); if (entry.Command != "Ping") { return; } row[PingAnalysisReport.PingHeartBeatInterval] = ParseHelper.ParseStringBetweenTokens(entry.RequestBody, "<HeartbeatInterval>", "</HeartbeatInterval>"); if (entry.RequestBody.Trim().Length > 0 && entry.RequestBody.Contains("xml")) { XElement root = XElement.Parse(entry.RequestBody.Trim()); XNamespace ns = root.Attribute("xmlns").Value; IEnumerable <XElement> folders = from f in root.Descendants(ns + "Folder") select(XElement) f; string foldersText = string.Empty; foreach (XElement folder in folders) { if (foldersText.Length > 0) { foldersText = foldersText + ", "; } foldersText = foldersText + (string)folder.Element(ns + "Id") + " (" + (string)folder.Element(ns + "Class") + ")"; } row[PingAnalysisReport.PingRequestFoldersText] = foldersText; } if (entry.ResponseBody.Trim().Length > 0 && entry.ResponseBody.Contains("xml")) { XElement root = XElement.Parse(entry.ResponseBody.Trim()); XNamespace ns2 = root.Attribute("xmlns").Value; IEnumerable <XElement> folders2 = from f in root.Descendants(ns2 + "Folder") select(XElement) f; string foldersText2 = string.Empty; foreach (XElement folder2 in folders2) { if (foldersText2.Length > 0) { foldersText2 = foldersText2 + ", "; } foldersText2 = foldersText2 + folder2.Value; } row[PingAnalysisReport.PingResponseFoldersText] = foldersText2; } this.ReportRows.Add(row); }
public static SyncRequest Load(MailboxLogEntry entry) { SyncRequest cmd = new SyncRequest(entry); cmd.Parse(); return(cmd); }
public static SyncResponse Load(MailboxLogEntry entry) { SyncResponse cmd = new SyncResponse(entry); cmd.Parse(); return(cmd); }
internal override void ProcessLogEntry(MailboxLogEntry logEntry) { ReportRowBase row = null; if (TryGetRowFromEntry(logEntry, out row)) { this.ReportRows.Add(row); } }
internal override void ProcessLogEntry(MailboxLogEntry entry) { ReportRowBase row = new DummyReportRow(); // Find UID in request or response //IEnumerable<XElement> requestGoids = ParseHelper.GetXElements(entry.RequestBody, "GlobalObjId"); TrackGoids(ParseHelper.GetXElements(entry.ResponseBody, "GlobalObjId"), entry, row); //IEnumerable<XElement> requestUids = ParseHelper.GetXElements(entry.RequestBody, "UID"); TrackUids(ParseHelper.GetXElements(entry.ResponseBody, "UID"), entry, row); this.ReportRows.Add(row); }
private bool TryGetRowFromEntry(MailboxLogEntry logEntry, out ReportRowBase newRow) { newRow = null; try { var row = new BasicReportRow(logEntry); foreach (ReportColumnBase column in this.ReportColumns) { row[column.ColumnName] = column.CalculateColumnValue(logEntry); } newRow = row; return(true); } catch (Exception ex) { Debug.Assert(true, "Exception in TryGetRowFromEntry: " + ex.GetType().FullName + ", " + ex.Message); return(false); } }
private void TrackGoids(IEnumerable <XElement> goids, MailboxLogEntry entry, ReportRowBase row) { string uid = string.Empty; foreach (XElement goid in goids) { if (!TryConvertGoidToUid(goid.Value, out uid)) { continue; } MeetingTrackerItem meeting = GetTrackedMeeting(uid); ApplicationData applicationData = new ApplicationData(goid.Parent.Parent); // Check to see if the OrganizerBytes have changed... if (meeting.OrganizerBytes != applicationData.Organizer) { if (meeting.OrganizerBytes != 0) { row.Columns[MeetingTrackerReport.OrganizerChanged] = "TRUE"; } meeting.OrganizerBytes = applicationData.Organizer; } // Check to see if the meeting loses attendees if (!meeting.HasAttendees.HasValue) { meeting.HasAttendees = applicationData.HasAttendees; } else if (meeting.HasAttendees.Value != applicationData.HasAttendees) { row.Columns[MeetingTrackerReport.HasAttendeesChanged] = "TRUE"; meeting.HasAttendees = applicationData.HasAttendees; } } }
internal override void ProcessLogEntry(MailboxLogEntry entry) { ReportRowBase row = new DummyReportRow(); if (entry.Command != "Sync") { return; } // Sync request data SyncRequest sync = entry.RequestObject as SyncRequest; row[SyncAnalysisReport.SyncHeartbeatInterval] = sync.HeartbeatInterval.ToString(); foreach (Collection c in sync.Collections) { AppendValueToColumn(row, SyncAnalysisReport.SyncRequestCollectionIds, c.CollectionId); AppendValueToColumn(row, SyncAnalysisReport.SyncWindowSizes, c.WindowSize.ToString()); AppendValueToColumn(row, SyncAnalysisReport.SyncRequestKeys, c.SyncKey); // Track duplicate Sync requests in previous logs with matching CollectionId and SyncKey string duplicateTrackKey = c.CollectionId + c.SyncKey; if (!this.CurrentCollectionIdSyncKey.ContainsKey(duplicateTrackKey)) { this.CurrentCollectionIdSyncKey.Add(duplicateTrackKey, -1); } this.CurrentCollectionIdSyncKey[duplicateTrackKey]++; // If one or more duplicate is found the report it if (this.CurrentCollectionIdSyncKey[duplicateTrackKey] > 0) { AppendValueToColumn(row, SyncAnalysisReport.SyncDuplicateCounts, this.CurrentCollectionIdSyncKey[duplicateTrackKey].ToString()); } //if (duplicates.Count<ReportRow>() > 0) //{ // DateTime thisRequestTime = DateTime.Parse(row[FlatSyncAnalysisReport.RequestTime]); // DateTime lastDupeRequestTime = DateTime.Parse(duplicates.First<ReportRow>()[FlatSyncAnalysisReport.RequestTime]); // TimeSpan interval = new TimeSpan(thisRequestTime.Ticks - lastDupeRequestTime.Ticks); // AppendValueToColumn(row, SyncAnalyzer.SyncLastDuplicateIntervals, interval.Seconds.ToString()); //} // Process Commands issued in the Sync request if (c.Commands != null && c.Commands.Fetch != null && c.Commands.Fetch.ServerIds != null) { // Capture just a count of the ServerIds in the Fetch AppendValueToColumn(row, SyncAnalysisReport.SyncRequestFetchCountPerCollection, c.Commands.Fetch.ServerIds.Length.ToString()); // Capture the actual ServerIds for the Fetch foreach (ServerId serverId in c.Commands.Fetch.ServerIds) { AppendValueToColumn(row, SyncAnalysisReport.SyncRequestFetchServerIdsPerCollection, serverId.ToString()); } } } // Sync response data IEnumerable <XElement> responseKeys = ParseHelper.GetXElements(entry.ResponseBody, "SyncKey"); foreach (XElement responseKey in responseKeys) { AppendValueToColumn(row, SyncAnalysisReport.SyncResponseKeys, responseKey.Value); } //IEnumerable<XElement> collections = ParseHelper.GetXElements(entry.ResponseBody, "Collection"); //foreach (XElement collection in collections) //{ // IEnumerable<XElement> adds = ParseHelper.GetXElements(entry.ResponseBody, "Add"); // AppendValueToColumn(row, SyncAnalyzer.SyncResponseAdds, adds.ToString()); //} this.ReportRows.Add(row); }
internal abstract void ProcessLogEntry(MailboxLogEntry entry);
internal BasicReportRow(MailboxLogEntry logEntry) : base(logEntry.Name + logEntry.Identifier) { this.LogEntry = logEntry; }