private MiniProfiler() { IsActive = true; SqlProfiler = new SqlProfiler(this); _sw = StopwatchWrapper.StartNew(); Id = Guid.NewGuid(); Root = new Timing(this, null, "empty"); }
/// <summary> /// Called when 'reader' finishes its iterations and is closed. /// </summary> public static void Exception(this SqlProfiler sqlProfiler, ProfiledDbCommand command, SqlExecuteType type, Exception exception) { if (sqlProfiler == null) { return; } sqlProfiler.ExceptionImpl(command, type, exception); }
/// <summary> /// Finishes profiling for 'command', recording durations. /// </summary> public static void ExecuteFinish(this SqlProfiler sqlProfiler, ProfiledDbCommand command, SqlExecuteType type, DbDataReader reader = null) { if (sqlProfiler == null) { return; } sqlProfiler.ExecuteFinishImpl(command, type, reader); }
/// <summary> /// Called when 'reader' finishes its iterations and is closed. /// </summary> public static void ReaderFinish(this SqlProfiler sqlProfiler, IDataReader reader) { if (sqlProfiler == null) { return; } sqlProfiler.ReaderFinishedImpl(reader); }
/// <summary> /// Tracks when 'command' is started. /// </summary> public static void ExecuteStart(this SqlProfiler sqlProfiler, ProfiledDbCommand command, SqlExecuteType type) { if (sqlProfiler == null) { return; } sqlProfiler.ExecuteStartImpl(command, type); }