Exemplo n.º 1
0
 private MiniProfiler()
 {
     IsActive    = true;
     SqlProfiler = new SqlProfiler(this);
     _sw         = StopwatchWrapper.StartNew();
     Id          = Guid.NewGuid();
     Root        = new Timing(this, null, "empty");
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }