示例#1
0
 /// <summary>
 /// Tracks when 'command' is started.
 /// </summary>
 public static void ExecuteStart(this SqlProfiler sqlProfiler, DbCommand command, ExecuteType type)
 {
     if (sqlProfiler == null)
     {
         return;
     }
     sqlProfiler.ExecuteStartImpl(command, type);
 }
示例#2
0
 /// <summary>
 /// Called when 'reader' finishes its iterations and is closed.
 /// </summary>
 public static void ReaderFinish(this SqlProfiler sqlProfiler, DbDataReader reader)
 {
     if (sqlProfiler == null)
     {
         return;
     }
     sqlProfiler.ReaderFinishedImpl(reader);
 }
示例#3
0
 /// <summary>
 /// Finishes profiling for 'command', recording durations.
 /// </summary>
 public static void ExecuteFinish(this SqlProfiler sqlProfiler, DbCommand command, ExecuteType type, DbDataReader reader = null)
 {
     if (sqlProfiler == null)
     {
         return;
     }
     sqlProfiler.ExecuteFinishImpl(command, type, reader);
 }
示例#4
0
 void IDbProfiler.ExecuteFinish(DbCommand profiledDbCommand, ExecuteType executeType, DbDataReader reader)
 {
     if (reader != null)
     {
         SqlProfiler.ExecuteFinish(profiledDbCommand, executeType, reader);
     }
     else
     {
         SqlProfiler.ExecuteFinish(profiledDbCommand, executeType);
     }
 }
示例#5
0
        /// <summary>
        /// Creates and starts a new MiniProfiler for the root <paramref name="url"/>, filtering <see cref="Timing"/> steps to <paramref name="level"/>.
        /// </summary>
        public Profiler(string url, ProfileLevel level = ProfileLevel.Info)
        {
            Id          = Guid.NewGuid();
            Level       = level;
            SqlProfiler = new SqlProfiler(this);
            MachineName = Environment.MachineName;
            Started     = DateTime.UtcNow;

            // stopwatch must start before any child Timings are instantiated
            _sw  = Settings.StopwatchProvider();
            Root = new Timing(this, parent: null, name: url);
        }
示例#6
0
 void IDbProfiler.ReaderFinish(DbDataReader reader)
 {
     SqlProfiler.ReaderFinish(reader);
 }
示例#7
0
        // IDbProfiler methods

        void IDbProfiler.ExecuteStart(DbCommand profiledDbCommand, ExecuteType executeType)
        {
            SqlProfiler.ExecuteStart(profiledDbCommand, executeType);
        }