Example #1
0
        public ProfileFrame(ProfileSession session, ProfileFrame parent, string name)
        {
            _session = session;
            _name = name;
            _startTicks = session.ElapsedTicks;

            if (parent != null)
            {
                parent.AddChild(this);
            }
        }
Example #2
0
        public async Task Invoke(HttpContext context)
        {
            var session = new ProfileSession();

            try
            {
                session.Start();
                await _next.Invoke(context);
            }
            finally
            {
                session.Stop();
                _logger.LogInformation("Request profiling data {0}.", session.ToJson());
            }
        }