Beispiel #1
0
 public void Start()
 {
     HttpContextAccessor.HttpContext.Items["ProfileSession"] = this;
     _stopwatch = Stopwatch.StartNew();
     _root = new ProfileFrame(this, null, "Root");
     _frameStack.Push(_root);
 }
Beispiel #2
0
        public IDisposable Step(string name)
        {
            var frame = new ProfileFrame(this, _frameStack.Peek(), name);
            _frameStack.Push(frame);

            return frame;
        }
Beispiel #3
0
        public ProfileFrame(ProfileSession session, ProfileFrame parent, string name)
        {
            _session = session;
            _name = name;
            _startTicks = session.ElapsedTicks;

            if (parent != null)
            {
                parent.AddChild(this);
            }
        }
Beispiel #4
0
 internal void PopFrame(ProfileFrame frame)
 {
     // pop until we find this frame
     while (_frameStack.Count > 1 && _frameStack.Pop() != frame)
         ;
 }
Beispiel #5
0
        private void AddChild(ProfileFrame child)
        {
            if (_children == null)
            {
                _children = new List<ProfileFrame>();
            }

            _children.Add(child);
        }