Esempio n. 1
0
 /// <summary>
 /// Stops the current profiling session.
 /// </summary>
 public void Stop(bool discardResults)
 {
     if (_profiler != null)
     {
         _profiler.StopImpl();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Stops the current profiling session.
 /// </summary>
 /// <param name="discardResults">
 /// When true, clears the <see cref="MiniProfiler.Current"/>, allowing profiling to
 /// be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled.
 /// </param>
 public void Stop(bool discardResults)
 {
     _profiler?.StopImpl();
     if (discardResults)
     {
         _profiler = null;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Stops the current profiling session.
 /// </summary>
 public void Stop(bool discardResults)
 {
     if (_profiler != null)
     {
         _profiler.StopImpl();
         _profiler.IsActive = false;
         // save the profiler
         SaveProfiler();
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Stops the profiler and marks it as inactive.
        /// </summary>
        /// <returns>True if successful, false if Stop had previously been called on this profiler</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="profiler"/> is null</exception>
        protected static bool StopProfiler(MiniProfiler profiler)
        {
            if (profiler == null)
                throw new ArgumentNullException("profiler");

            if (!profiler.StopImpl())
                return false;

            profiler.IsActive = false;
            return true;
        }
Esempio n. 5
0
        /// <summary>
        /// Stops the profiler and marks it as inactive.
        /// </summary>
        /// <param name="profiler">The profiler to stop</param>
        /// <returns>True if successful, false if Stop had previously been called on this profiler</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="profiler"/> is null</exception>
        protected static bool StopProfiler(MiniProfiler profiler)
        {
            if (profiler == null)
            {
                throw new ArgumentNullException("profiler");
            }

            if (!profiler.StopImpl())
            {
                return(false);
            }

            profiler.IsActive = false;
            return(true);
        }