/// <summary> /// Stops the current profiling session. /// </summary> public void Stop(bool discardResults) { if (_profiler != null) { _profiler.StopImpl(); } }
/// <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; } }
/// <summary> /// Stops the current profiling session. /// </summary> public void Stop(bool discardResults) { if (_profiler != null) { _profiler.StopImpl(); _profiler.IsActive = false; // save the profiler SaveProfiler(); } }
/// <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; }
/// <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); }