/// <summary> /// Build the subtree of <see cref="Timing"/> objects with <paramref name="parent"/> at the top. /// Used recursively. /// </summary> /// <param name="parent">Parent <see cref="Timing"/> to be evaluated.</param> /// <param name="timingsLookupByParent">Key: parent timing Id; Value: collection of all <see cref="Timing"/> objects under the given parent.</param> private void PopulateChildTimings(Timing parent, ILookup <Guid, Timing> timingsLookupByParent) { if (timingsLookupByParent.Contains(parent.Id)) { foreach (var timing in timingsLookupByParent[parent.Id].OrderBy(x => x.StartMilliseconds)) { parent.AddChild(timing); PopulateChildTimings(timing, timingsLookupByParent); } } }
private void SetEventNameStopCurrentTiming(IDotvvmRequestContext context, string eventName) { if (currentTiming != null) { var mp = StackExchange.Profiling.MiniProfiler.Current; foreach (var child in mp.Root.Children.Where(c => c != currentTiming && c.StartMilliseconds >= currentTiming.StartMilliseconds).ToArray()) { mp.Root.Children.Remove(child); currentTiming.AddChild(child); } currentTiming.Name = eventName; currentTiming.Stop(); currentTiming = null; } }
/// <summary> /// Build the subtree of <see cref="Timing"/> objects with <paramref name="parent"/> at the top. /// Used recursively. /// </summary> /// <param name="parent">Parent <see cref="Timing"/> to be evaluated.</param> /// <param name="timingsLookupByParent">Key: parent timing Id; Value: collection of all <see cref="Timing"/> objects under the given parent.</param> private void PopulateChildTimings(Timing parent, ILookup<Guid, Timing> timingsLookupByParent) { if (timingsLookupByParent.Contains(parent.Id)) { foreach (var timing in timingsLookupByParent[parent.Id].OrderBy(x => x.StartMilliseconds)) { parent.AddChild(timing); PopulateChildTimings(timing, timingsLookupByParent); } } }