Beispiel #1
0
        /// <summary>
        /// Pops all events from the hierarchy up to and including the specified event.
        /// And will then pop <paramref name="plus"/> more
        /// </summary>
        public IUnstoppablePerformanceEvent PopToEvent(IUnstoppablePerformanceEvent @event, int plus)
        {
            if (_hierarchy.Count == 1)
            {
                _current.EventCompleted();
                return(_current);
            }
            bool ready = false;

            do
            {
                if (object.ReferenceEquals(_current, @event))
                {
                    ready = true;
                }
                if (ready)
                {
                    if (plus <= 0)
                    {
                        break;
                    }
                    plus -= 1;
                }

                _current.EventCompleted();
                if (_hierarchy.Count <= 1)
                {
                    break;
                }
                _current = _hierarchy.Pop();
            } while (true);
            return(_current);
        }
Beispiel #2
0
 /// <summary>
 /// Pops all events from the hierarchy up to and including the specified event, and sets
 /// the current element to it's parent. The specified event will be completed in this process
 /// but the parent will not.
 /// </summary>
 public IUnstoppablePerformanceEvent PopComplete(IUnstoppablePerformanceEvent @event)
 {
     return(PopToEvent(@event, 1));
 }
 /// <see cref="PerformanceEventTracker.PopComplete"/>
 public static IUnstoppablePerformanceEvent PerfEvent_PopComplete(this ILogStream log, IUnstoppablePerformanceEvent evt)
 {
     return(GetData(log).Tracker.PopComplete(evt));
 }
Beispiel #4
0
 /// <summary>
 /// Pops all events from the hierarchy up to and including the specified event.
 /// </summary>
 public IUnstoppablePerformanceEvent PopToEvent(IUnstoppablePerformanceEvent @event)
 {
     return(PopToEvent(@event, 0));
 }
 public static void IncrementCounterBy(this ILogStream log, IRawCounterToken ct, IUnstoppablePerformanceEvent value)
 {
     log.IncrementCounterBy(ct, value.TimeData.ElapsedTicks);
 }