示例#1
0
        /// <summary>
        /// Clears the current profiling session &amp; step id.
        /// </summary>
        public void Clear()
        {
            // clear callcontext container
            _callContextProfilingSessionContainer.Clear();

            // clear current session
            CurrentSession = null;

            // clear step id
            CurrentSessionStepId = null;
        }
示例#2
0
        /// <summary>
        /// Clears the current profiling session &amp; step id.
        /// </summary>
        public void Clear()
        {
            // clear web container
            _webProfilingSessionContainer.Clear();

            // clear current session
            CurrentSession = null;

            // clear step id
            CurrentSessionStepId = null;
        }
示例#3
0
        /// <summary>
        /// Stops the current profiling session.
        /// </summary>
        /// <param name="discardResults">
        /// When true, discards the profiling results of the entire profiling session.
        /// </param>
        public static void Stop(bool discardResults = false)
        {
            var profilingSession = Current;

            if (profilingSession != null)
            {
                try
                {
                    if (CircularBuffer != null)
                    {
                        CircularBuffer.Add(profilingSession.Profiler.GetTimingSession());
                    }

                    profilingSession._profiler.Stop(discardResults);
                }
                catch (Exception ex)
                {
                    HandleExceptionHandler(ex, typeof(ProfilingSession));
                }
            }

            // Clear the current profiling session on stopping
            _profilingSessionContainer.Clear();
        }