Example #1
0
 private MiniProfiler()
 {
     IsActive    = true;
     SqlProfiler = new SqlProfiler(this);
     _sw         = StopwatchWrapper.StartNew();
     Id          = Guid.NewGuid();
     Root        = new Timing(this, null, "empty");
 }
Example #2
0
 /// <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);
 }
Example #3
0
 /// <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);
 }
Example #4
0
 /// <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);
 }
Example #5
0
 /// <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);
 }