internal void AppendExpandingTransfer(TraceRecord trace, ExpandingLevel level) { if (trace != null && trace.IsTransfer && trace.DataSource.Activities.ContainsKey(trace.RelatedActivityID)) { Dictionary <string, Activity> dictionary = new Dictionary <string, Activity>(); ActivityAnalyzerHelper.DetectPossibleParentActivities(trace.DataSource.Activities[trace.RelatedActivityID], trace.DataSource.Activities, dictionary, ActivityAnalyzerHelper.INIT_ACTIVITY_TREE_DEPTH2, null); List <long> list = new List <long>(); foreach (TraceRecord value in collapsingTransfers.Values) { if (value.RelatedActivityID == trace.RelatedActivityID && collapsingTransfers.ContainsKey(value.TraceID)) { list.Add(value.TraceID); } else if (dictionary.ContainsKey(value.RelatedActivityID)) { list.Add(value.TraceID); } } foreach (long item in list) { collapsingTransfers.Remove(item); } if (!expandingTransfers.ContainsKey(trace.TraceID)) { expandingTransfers.Add(trace.TraceID, trace); } if (!expandingTransferTraceLevel.ContainsKey(trace.TraceID)) { expandingTransferTraceLevel.Add(trace.TraceID, level); } } }
private void ExpandTransfer(TraceRecord trace, ExpandingLevel level) { if (trace != null && AllActivities.ContainsKey(trace.RelatedActivityID)) { Activity activity = AllActivities[trace.RelatedActivityID]; List <TraceRecord> list = activity.LoadTraceRecords(isLoadActivityBoundary: true); List <TraceRecord> list2 = new List <TraceRecord>(); foreach (TraceRecord item in list) { if (level == ExpandingLevel.ExpandAll) { list2.Add(item); } if (item.TraceID != trace.TraceID && item.IsTransfer) { if (item.ActivityID == activity.Id && item.RelatedActivityID != trace.ActivityID && !suppressedActivityIds.Contains(item.RelatedActivityID)) { DecideWhetherHideActivityOrNotForExpandTrace(item.RelatedActivityID); } else if (item.RelatedActivityID == activity.Id && item.ActivityID != trace.ActivityID && !suppressedActivityIds.Contains(item.ActivityID)) { DecideWhetherHideActivityOrNotForExpandTrace(item.ActivityID); } } } if (list2.Count != 0) { SaveTargetTraceRecords(activity, list2); InternalAnalysisActivityParents(activity, ActivityAnalyzerHelper.INIT_ACTIVITY_TREE_DEPTH); } } }
internal void AppendExpandingActivity(string activityId, ExpandingLevel level) { if (!string.IsNullOrEmpty(activityId)) { if (expandingActivities.ContainsKey(activityId)) { expandingActivities[activityId] = level; } else { expandingActivities.Add(activityId, level); } } }
private void ExpandActivity(Activity activity, ExpandingLevel level) { if (activity != null) { List <TraceRecord> list = activity.LoadTraceRecords(isLoadActivityBoundary: true); List <TraceRecord> list2 = new List <TraceRecord>(); foreach (TraceRecord item in list) { if (item.IsTransfer) { if (item.ActivityID == activity.Id && !suppressedActivityIds.Contains(item.RelatedActivityID)) { DecideWhetherHideActivityOrNotForExpandTrace(item.RelatedActivityID); } else if (item.RelatedActivityID == activity.Id && !suppressedActivityIds.Contains(item.ActivityID)) { DecideWhetherHideActivityOrNotForExpandTrace(item.ActivityID); } } switch (level) { case ExpandingLevel.ExpandAll: list2.Add(item); break; case ExpandingLevel.ExpandTransferOut: if (item.IsTransfer) { list2.Add(item); } else if (item.Level == TraceEventType.Error || item.Level == TraceEventType.Warning || item.Level == TraceEventType.Critical || ((item.IsMessageReceivedRecord || item.IsMessageSentRecord) && (!string.IsNullOrEmpty(item.MessageID) || !string.IsNullOrEmpty(item.RelatesToMessageID)))) { list2.Add(item); } break; } } RemoveTraceInActivity(activity); if (list2.Count != 0) { SaveTargetTraceRecords(activity, list2); } InternalAnalysisActivityParents(activity, ActivityAnalyzerHelper.INIT_ACTIVITY_TREE_DEPTH); } }