internal static int Fill(List <HeavyProfofilerEntryTS> result, HeavyProfilerEntry entry, int asyncDepth, long now) { result.Add(new HeavyProfofilerEntryTS(entry, true, now) { AsyncDepth = asyncDepth }); if (entry.Entries == null) { return(asyncDepth); } Dictionary <HeavyProfilerEntry, int> newDepths = new Dictionary <HeavyProfilerEntry, int>(); for (int i = 0; i < entry.Entries.Count; i++) { var e = entry.Entries[i]; var maxAsyncDepth = newDepths.Where(kvp => kvp.Key.Overlaps(e)).Max(a => (int?)a.Value); var newAsyncDepth = Fill(result, e, maxAsyncDepth.HasValue ? maxAsyncDepth.Value + 1 : asyncDepth + 1, now); newDepths.Add(e, newAsyncDepth); } return(newDepths.Values.Max()); }
public HeavyProfofilerEntryTS(HeavyProfilerEntry e, bool fullAditionalData, long now) { BeforeStart = e.BeforeStart; Start = e.Start; End = e.End ?? now; Elapsed = e.ElapsedToString(); IsFinished = e.End.HasValue; Role = e.Role; Color = GetColor(e.Role); Depth = e.Depth; FullIndex = e.FullIndex(); AdditionalData = fullAditionalData ? e.AdditionalData : e.AdditionalDataPreview(); }
public HeavyProfofilerEntryTS(HeavyProfilerEntry e, bool fullAditionalData) { BeforeStart = e.BeforeStart; Start = e.Start; End = e.End; Elapsed = e.ElapsedToString(); Role = e.Role; Color = GetColor(e.Role); Depth = e.Depth; FullIndex = e.FullIndex(); AdditionalData = fullAditionalData ? e.AdditionalData : e.AdditionalDataPreview(); }
public bool Overlaps(HeavyProfilerEntry e) { return(new Interval <long>(this.BeforeStart, this.EndOrNow) .Overlaps(new Interval <long>(e.BeforeStart, e.EndOrNow))); }
public static void ImportXml(XDocument doc, bool rebaseTime) { var list = doc.Element("Logs") !.Elements("Log").Select(xLog => HeavyProfilerEntry.ImportXml(xLog, null)).ToList(); ImportEntries(list, rebaseTime); }