/// <summary> /// Tracks when 'command' is started. /// </summary> public static void ExecuteStart(this SqlProfiler sqlProfiler, IDbCommand command, SqlExecuteType type) { if (sqlProfiler == null) { return; } sqlProfiler.ExecuteStartImpl(command, type); }
/// <summary> /// Finishes profiling for 'command', recording durations. /// </summary> public static void ExecuteFinish( this SqlProfiler sqlProfiler, IDbCommand command, SqlExecuteType type, DbDataReader reader = null) { 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> /// Finishes profiling for 'command', recording durations. /// </summary> public static void ExecuteFinish(this SqlProfiler sqlProfiler, IDbCommand command, ExecuteType type, DbDataReader reader = null) { if (sqlProfiler == null) { return; } sqlProfiler.ExecuteFinishImpl(command, type, reader); }
void IDbProfiler.ExecuteFinish(IDbCommand profiledDbCommand, ExecuteType executeType, DbDataReader reader) { if (reader != null) { SqlProfiler.ExecuteFinish(profiledDbCommand, executeType, reader); } else { SqlProfiler.ExecuteFinish(profiledDbCommand, executeType); } }
/// <summary> /// Initialises a new instance of the <see cref="MiniProfiler"/> class. /// Creates and starts a new MiniProfiler for the root <paramref name="url"/>, filtering <see cref="Timing"/> steps to <paramref name="level"/>. /// </summary> /// <param name="url"> /// The URL. /// </param> /// <param name="level"> /// The level. /// </param> public MiniProfiler(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, null, url); }
/// <summary> /// Creates and starts a new MiniProfiler for the root <paramref name="url"/>, filtering <see cref="Timing"/> steps to <paramref name="level"/>. /// </summary> public MiniProfiler(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); }
/// <summary> /// Initialises a new instance of the <see cref="MiniProfiler"/> class. Creates and starts a new MiniProfiler /// for the root <paramref name="url"/>. /// </summary> public MiniProfiler(string url) { Id = Guid.NewGuid(); #pragma warning disable 612,618 Level = ProfileLevel.Info; #pragma warning restore 612,618 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, null, url); }
void IDbProfiler.ReaderFinish(IDataReader reader) { SqlProfiler.ReaderFinish(reader); }
// IDbProfiler methods void IDbProfiler.ExecuteStart(IDbCommand profiledDbCommand, ExecuteType executeType) { SqlProfiler.ExecuteStart(profiledDbCommand, executeType); }
/// <summary> /// Called when 'reader' finishes its iterations and is closed. /// </summary> public static void ReaderFinish(this SqlProfiler sqlProfiler, IDataReader reader) { sqlProfiler?.ReaderFinishedImpl(reader); }
/// <summary> /// Tracks when 'command' is started. /// </summary> public static void ExecuteStart(this SqlProfiler sqlProfiler, IDbCommand command, SqlExecuteType type) { sqlProfiler?.ExecuteStartImpl(command, type); }