Ejemplo n.º 1
0
 /// <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);
         }
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 /// <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);
         }
     }
 }